<p>When iPXE is compiled as an option ROM (I tried the e1000 driver), it causes a<br>
complete boot stall on the latest release of OVMF for EDK2 [1], run on the<br>
latest QEMU 4.2.0. Further debugging traced it down to commit <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/ipxe/ipxe/commit/d8c500b7945e57023dde5bd0be2b0e40963315d9/hovercard" href="https://github.com/ipxe/ipxe/commit/d8c500b7945e57023dde5bd0be2b0e40963315d9"><tt>d8c500b</tt></a> ("[efi]<br>
Drop to TPL_APPLICATION when gathering entropy"). Specifically, somehow the<br>
whole boot process stalls, when trying to RaiseTPL() back to TPL_CALLBACK in<br>
efi_entropy_disable().</p>
<p>I'm also not actually sure the code in efi_entropy_enable() /<br>
efi_entropy_disable() actually runs at TPL_CALLBACK (at least for the first<br>
time) as I dumped the current TPL, when the first efi_entropy_enable() call was<br>
made and it showed iPXE was running at TPL_APPLICATION level.</p>
<p>While the whole idea of constantly running at elevated task priority level is<br>
rather questionable for me, proposing to fix at least the entropy gathering by<br>
not messing with timers and priority levels at all, if we have EFI_RNG_PROTOCOL<br>
provided.</p>
<p>[1] <a href="https://github.com/tianocore/edk2">https://github.com/tianocore/edk2</a></p>
<p>Signed-off-by: Ignat Korchagin <a href="mailto:ignat@cloudflare.com">ignat@cloudflare.com</a></p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/ipxe/ipxe/pull/101'>https://github.com/ipxe/ipxe/pull/101</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>[efi] Don't use timers to gather entropy, if EFI_RNG_PROTOCOL is available</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/ipxe/ipxe/pull/101/files#diff-0">src/interface/efi/efi_entropy.c</a>
    (42)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/ipxe/ipxe/pull/101.patch'>https://github.com/ipxe/ipxe/pull/101.patch</a></li>
  <li><a href='https://github.com/ipxe/ipxe/pull/101.diff'>https://github.com/ipxe/ipxe/pull/101.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/ipxe/ipxe/pull/101?email_source=notifications&email_token=AAFNGVAIMZR66QN44KKAMKDQ2YESRA5CNFSM4J742WXKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IC32JEA">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAFNGVGO6G6UPODHBDJ7PHDQ2YESRANCNFSM4J742WXA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AAFNGVDPFFDH3ZKRONZ5Q7DQ2YESRA5CNFSM4J742WXKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IC32JEA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/ipxe/ipxe/pull/101?email_source=notifications\u0026email_token=AAFNGVAIMZR66QN44KKAMKDQ2YESRA5CNFSM4J742WXKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IC32JEA",
"url": "https://github.com/ipxe/ipxe/pull/101?email_source=notifications\u0026email_token=AAFNGVAIMZR66QN44KKAMKDQ2YESRA5CNFSM4J742WXKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IC32JEA",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>