mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-04 23:24:56 +00:00
cpu: cache the maximum input value for CPUID extended function
Per SDM:
When CPUID executes with EAX set to 80000000H, the processor returns
the highest value the processor recognizes for returning extended
processor information. The value is returned in the EAX register and is
processor specific.
This patch caches this value in the global cpuinfo_x86.cpuid_leaves. This
value will be used to check the availability of any CPUID extended
function.
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -225,6 +225,7 @@ enum feature_word {
|
||||
FEAT_7_0_EBX, /* CPUID[EAX=7,ECX=0].EBX */
|
||||
FEAT_7_0_ECX, /* CPUID[EAX=7,ECX=0].ECX */
|
||||
FEAT_7_0_EDX, /* CPUID[EAX=7,ECX=0].EDX */
|
||||
FEAT_8000_0000_EAX, /* CPUID[8000_0000].EAX */
|
||||
FEAT_8000_0001_ECX, /* CPUID[8000_0001].ECX */
|
||||
FEAT_8000_0001_EDX, /* CPUID[8000_0001].EDX */
|
||||
FEATURE_WORDS,
|
||||
|
||||
@@ -113,7 +113,8 @@
|
||||
#define CPUID_TLB 2
|
||||
#define CPUID_SERIALNUM 3
|
||||
#define CPUID_EXTEND_FEATURE 7
|
||||
#define CPUID_EXTEND_FUNCTION_1 0x80000001
|
||||
#define CPUID_MAX_EXTENDED_FUNCTION 0x80000000
|
||||
#define CPUID_EXTEND_FUNCTION_1 0x80000001
|
||||
|
||||
static inline void __cpuid(uint32_t *eax, uint32_t *ebx,
|
||||
uint32_t *ecx, uint32_t *edx)
|
||||
|
||||
Reference in New Issue
Block a user