From d4b38f8ec0d178592cdc9b65542c5add5998357b Mon Sep 17 00:00:00 2001 From: "Hui, Chunyang" Date: Wed, 10 May 2023 05:47:40 +0000 Subject: [PATCH] [test] Fix false alarm for cpuid test For new x86 processors, CPUID leaf 1FH is introduced as the V2 Extended Topology Enumeration and is a prefered superset to leaf 0BH. Add extra case to skip the EDX check because the corresponding value is related with logical processor (x2APIC ID). --- test/cpuid/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/cpuid/main.c b/test/cpuid/main.c index 88a5182c..6b5837c0 100644 --- a/test/cpuid/main.c +++ b/test/cpuid/main.c @@ -35,8 +35,8 @@ static bool is_cpuidinfo_equal(int leaf, t_cpuid_t *cpu, t_cpuid_t *cpu_sgx) { (cpu->ecx == cpu_sgx->ecx) && (cpu->edx == cpu_sgx->edx)); } - /* Leaf 0BH and 06H CPUID.EDX is related with logical processor. */ - if (leaf == 0xB || leaf == 0x6) { + /* Leaf 1FH, 0BH and 06H CPUID.EDX is related with logical processor. */ + if (leaf == 0x1F || leaf == 0xB || leaf == 0x6) { return ((cpu->eax == cpu_sgx->eax) && (cpu->ebx == cpu_sgx->ebx) && (cpu->ecx == cpu_sgx->ecx));