<p>On Tue, Apr  6, 2021 at 08:03 PM, Laszlo Ersek wrote:</p>

<blockquote>
<p>(1) I think we should use a new TianoCore feature request BZ for this
feature, and the commit messages should link it. (I understand the
library only factors out existent logic, but still.)</p>
</blockquote>

<p>sure. <a href="https://bugzilla.tianocore.org/show_bug.cgi?id=3303" target="_blank">https://bugzilla.tianocore.org/show_bug.cgi?id=3303</a></p>

<blockquote>
<p>(2) As I understand it, a platform can provide microcode in three ways:
- via the "microcode patch" GUIDed HOB (PEI and DXE phases both),
- via the "shadow microcode" PPI (PEI phase only),
- via the PcdCpuMicrocodePatch* PCDs (PEI and DXE phases both).</p>

<p>If a platform uses none of these methods (for example, OVMF does not),
then I think it would benefit from a Null instance of the new
MicrocodeLib class.</p>

<p>Would you consider introducing a Null instance too, and using that one
in the OVMF DSC files?</p>
</blockquote>

<p>No. I don't think it's necessary for a NULL instance.
Because:
1. MicrocodePatch GUIDed HOB is only produced when "shadow microcode" PPI or "PcdCpuMicrocodePatch *" exists.
    I will further simplify today's MpInitLib to skip loading microcode when this HOB exists (because DXE re-load is unnecessary).
    This is captured by <a href="https://bugzilla.tianocore.org/show_bug.cgi?id=3155" target="_blank">https://bugzilla.tianocore.org/show_bug.cgi?id=3155</a>.</p>

<ol>
<li><p>Today's logic only calls the MicrocodeLib API when "shadow microcode" PPI or "PcdCpuMicrocodePatch *" exists.
Even NULL instance is provided, it's not called.</p></li>

<li><p>MicrocodeLib calls ASSERT() when the supplied microcode binary is NULL.
If the logic in MpInitLib is changed by accident to allow the call to MicrocodeLib even in OVMF, the assertion can catch this.</p></li>
</ol>


 <div width="1" style="color:white;clear:both">_._,_._,_</div> <hr> Groups.io Links:<p>   You receive all messages sent to this group.    <p> <a target="_blank" href="https://edk2.groups.io/g/devel/message/73753">View/Reply Online (#73753)</a> |    |  <a target="_blank" href="https://groups.io/mt/81796730/1813853">Mute This Topic</a>  | <a href="https://edk2.groups.io/g/devel/post">New Topic</a><br>    <a href="https://edk2.groups.io/g/devel/editsub/1813853">Your Subscription</a> | <a href="mailto:devel+owner@edk2.groups.io">Contact Group Owner</a> |  <a href="https://edk2.groups.io/g/devel/unsub">Unsubscribe</a>  [edk2-devel-archive@redhat.com]<br> <div width="1" style="color:white;clear:both">_._,_._,_</div>