MCPcopy Create free account
hub / github.com/coreboot/coreboot / is_sgx_supported

Function is_sgx_supported

util/inteltool/cpu.c:166–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164}
165
166static int is_sgx_supported(int cpunum)
167{
168 cpuid_result_t cpuid_regs;
169 msr_t msr;
170
171 /* CPUID leaf 0x7 subleaf 0x0 to detect SGX support
172 details are mentioned in Intel SDM Chap.36- section 36.7 */
173 cpuid_regs = cpuid_ext(0x7, 0x0);
174 msr = rdmsr_from_cpu(cpunum, MTRR_CAP_MSR);
175 return ((cpuid_regs.ebx & SGX_SUPPORTED) && (msr.lo & PRMRR_SUPPORTED));
176}
177
178static int is_sgx_enabled(int cpunum)
179{

Callers 1

print_sgxFunction · 0.70

Calls 2

cpuid_extFunction · 0.70
rdmsr_from_cpuFunction · 0.70

Tested by

no test coverage detected