| 272 | } |
| 273 | |
| 274 | static bool is_keylocker_supported(void) |
| 275 | { |
| 276 | cpuid_result_t cpuid_regs; |
| 277 | msr_t msr; |
| 278 | |
| 279 | /* |
| 280 | * CPUID leaf 0x7 subleaf 0x0 to detect Intel Key Locker support. |
| 281 | * The specification of Key Locker can be found at: https://www.intel.com/ |
| 282 | * content/www/us/en/develop/download/intel-key-locker-specification.html |
| 283 | * The spec can also be found via document #343965 on Intel's site. |
| 284 | */ |
| 285 | cpuid_regs = cpuid_ext(CPUID_STRUCT_EXTENDED_FEATURE_FLAGS, 0x0); |
| 286 | msr = rdmsr_from_cpu(0, MTRR_CAP_MSR); |
| 287 | return ((cpuid_regs.ecx & KEYLOCKER_SUPPORTED) && (msr.lo & PRMRR_SUPPORTED)); |
| 288 | } |
| 289 | |
| 290 | static bool is_aeskl_enabled(void) |
| 291 | { |
no test coverage detected