[ipxe-devel] [PATCH 1/1] efi: provide possibility to disable cpu_nap
Heinrich Schuchardt
xypron.glpk at gmx.de
Fri Jul 14 02:15:00 UTC 2017
On 07/14/2017 12:15 AM, Michael Brown wrote:
> On 13/07/17 12:00, Heinrich Schuchardt wrote:
>> Why do we need cpu_nap in the keyboard loop at all when we are in an
>> UEFI context. Shouldn't UEFI WaitForEvent be used to care about the idle
>> CPU?
>
> No. iPXE runs in three platform environments, two of which are nothing
> to do with UEFI. Any code that doesn't have to be platform-specific is
> implemented in as generic a way as possible. I am not going to start
> polluting the entire codebase with wholly unnecessary UEFI-specific
> reimplementations of already working code.
There are only three places using cpu_nap().
It would require some refactoring to use WaitForEvent here.
To minimize code changes I suggested an #ifndef in my patch.
>
> I have given you working sample code that solves your problem in an
> simple, generic way at a cost (for x86_64) of only eight bytes in the
> final binary. Did you even try testing this?
>
> Michael
>
I am on an arm64 system, not on x86_64.
Your sample code does not check that interrupts are actually generated
but analyzes the ability of the CPU to handle interrupts.
The register setting may indicate that the CPU is ready to accept
interrupts but if no interrupt is generated the halt state is never left.
I still do not understand what is wrong about disabling cpu_nap() at
compile time.
Best regards
Heinrich
More information about the ipxe-devel
mailing list