summaryrefslogtreecommitdiff
path: root/src/soc/intel
diff options
context:
space:
mode:
authorPratikkumar Prajapati <pratikkumar.v.prajapati@intel.com>2023-01-03 18:10:42 -0800
committerSridhar Siricilla <sridhar.siricilla@intel.com>2023-01-06 03:38:18 +0000
commit17c847b5eab2ae5bbe709b7cfb7c02f6fa0395e5 (patch)
tree29f9e3fc4f63865b55efe0c25397eca601a38340 /src/soc/intel
parent2819edb4972022715c6518078dbde3e44937cdd5 (diff)
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 <pratikkumar.v.prajapati@intel.com> Change-Id: If680ffff64e2e1dabded8c03c4042d349a11b635 Reviewed-on: https://review.coreboot.org/c/coreboot/+/71646 Reviewed-by: Subrata Banik <subratabanik@google.com> Reviewed-by: Sridhar Siricilla <sridhar.siricilla@intel.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/intel')
-rw-r--r--src/soc/intel/common/block/cpu/cpulib.c10
1 files 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));
}