From 17c847b5eab2ae5bbe709b7cfb7c02f6fa0395e5 Mon Sep 17 00:00:00 2001 From: Pratikkumar Prajapati Date: Tue, 3 Jan 2023 18:10:42 -0800 Subject: [PATCH] soc/intel/common: Use CPUID_STRUCT_EXTENDED_FEATURE_FLAGS macro Use CPUID_STRUCT_EXTENDED_FEATURE_FLAGS macro to get extended CPU capabilities flags using cpuid_ext inline function. Signed-off-by: Pratikkumar Prajapati Change-Id: If680ffff64e2e1dabded8c03c4042d349a11b635 Reviewed-on: https://review.coreboot.org/c/coreboot/+/71646 Reviewed-by: Subrata Banik Reviewed-by: Sridhar Siricilla Tested-by: build bot (Jenkins) --- src/soc/intel/common/block/cpu/cpulib.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/soc/intel/common/block/cpu/cpulib.c b/src/soc/intel/common/block/cpu/cpulib.c index 534feb1155..1f983255ce 100644 --- a/src/soc/intel/common/block/cpu/cpulib.c +++ b/src/soc/intel/common/block/cpu/cpulib.c @@ -506,8 +506,8 @@ bool is_tme_supported(void) { struct cpuid_result cpuid_regs; - cpuid_regs = cpuid_ext(0x7, 0x0); /* ECX[13] is feature capability */ - + /* ECX[13] is feature capability */ + cpuid_regs = cpuid_ext(CPUID_STRUCT_EXTENDED_FEATURE_FLAGS, 0x0); return (cpuid_regs.ecx & TME_SUPPORTED); } @@ -529,7 +529,8 @@ bool is_sgx_supported(void) struct cpuid_result cpuid_regs; msr_t msr; - cpuid_regs = cpuid_ext(0x7, 0x0); /* EBX[2] is feature capability */ + /* EBX[2] is feature capability */ + cpuid_regs = cpuid_ext(CPUID_STRUCT_EXTENDED_FEATURE_FLAGS, 0x0); msr = rdmsr(MTRR_CAP_MSR); /* Bit 12 is PRMRR enablement */ return ((cpuid_regs.ebx & SGX_SUPPORTED) && (msr.lo & MTRR_CAP_PRMRR)); } @@ -539,7 +540,8 @@ bool is_keylocker_supported(void) struct cpuid_result cpuid_regs; msr_t msr; - cpuid_regs = cpuid_ext(0x7, 0x0); /* ECX[23] is feature capability */ + /* ECX[23] is feature capability */ + cpuid_regs = cpuid_ext(CPUID_STRUCT_EXTENDED_FEATURE_FLAGS, 0x0); msr = rdmsr(MTRR_CAP_MSR); /* Bit 12 is PRMRR enablement */ return ((cpuid_regs.ecx & KEYLOCKER_SUPPORTED) && (msr.lo & MTRR_CAP_PRMRR)); }