iPXE - Open Source Boot Firmware

[cpuid] Allow input %ecx value to be specified
authorMichael Brown <mcb30@ipxe.org>
Thu, 15 Jun 2017 13:50:20 +0000 (14:50 +0100)
committerMichael Brown <mcb30@ipxe.org>
Fri, 16 Jun 2017 00:17:48 +0000 (01:17 +0100)
commita6a5825f8d658834610de31b7b9be2e7d0a8804e
treef51a8b343176bbf7c31483006060e93dc0161924
parentc8cb867d655227d779ce8ce9e392e853997b01dd
[cpuid] Allow input %ecx value to be specified

For some CPUID leaves (e.g. %eax=0x00000004), the result depends on
the input value of %ecx.  Allow this subfunction number to be
specified as a parameter to the cpuid() wrapper.

The subfunction number is exposed via the ${cpuid/...} settings
mechanism using the syntax

  ${cpuid/<subfunction>.0x40.<register>.<function>}

e.g.

  ${cpuid/0.0x40.0.0x0000000b}
  ${cpuid/1.0x40.0.0x0000000b}

to retrieve the CPU topology information.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/arch/x86/core/cpuid.c
src/arch/x86/core/cpuid_settings.c
src/arch/x86/core/rdtsc_timer.c
src/arch/x86/drivers/hyperv/hyperv.c
src/arch/x86/drivers/xen/hvm.c
src/arch/x86/include/ipxe/cpuid.h