diff options
author | Michael Brown <mcb30@ipxe.org> | 2024-07-31 16:35:31 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2024-08-01 12:49:48 +0100 |
commit | 121d96b903b221e2c63fa0fc5a8901dc24645a47 (patch) | |
tree | 78a922651fadcc5c70218b7fd89ced8934c6452d /src/arch/x86/include | |
parent | c117e6a4811efa057dc70426d58a8dab75245862 (diff) | |
download | ipxe-121d96b903b221e2c63fa0fc5a8901dc24645a47.tar.gz |
[cpuid] Allow reading hypervisor CPUID leaves
Hypervisors typically intercept CPUID leaves in the range 0x40000000
to 0x400000ff, with leaf 0x40000000 returning the maximum supported
function within this range in register %eax.
iPXE currently masks off bit 30 from the requested CPUID leaf when
checking to see if a function is supported, which causes this check to
read from leaf 0x00000000 instead of 0x40000000.
Fix by including bit 30 within the mask.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch/x86/include')
-rw-r--r-- | src/arch/x86/include/ipxe/cpuid.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/arch/x86/include/ipxe/cpuid.h b/src/arch/x86/include/ipxe/cpuid.h index 90d1bf01d..99b91c5c8 100644 --- a/src/arch/x86/include/ipxe/cpuid.h +++ b/src/arch/x86/include/ipxe/cpuid.h @@ -33,6 +33,9 @@ struct x86_features { /** CPUID extended function */ #define CPUID_EXTENDED 0x80000000UL +/** CPUID hypervisor function */ +#define CPUID_HYPERVISOR 0x40000000UL + /** Get vendor ID and largest standard function */ #define CPUID_VENDOR_ID 0x00000000UL |