From: Jeff Fan Date: Wed, 15 Mar 2017 01:47:52 +0000 (+0800) Subject: UefiCpuPkg/CpuDxe: Remove MSR_IA32_MISC_ENABLE check X-Git-Tag: edk2-stable201903~4375 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=01eb3f39bbcc5b6474d69cff3922be8eb1856636;hp=78807f605082ecec60c3b465a6e6f3e01741bf2c UefiCpuPkg/CpuDxe: Remove MSR_IA32_MISC_ENABLE check The architectural MSR MSR_IA32_MISC_ENABLE is not supported by AMD processors. Because reading CPUID.80000001H:EDK[20] is enough to check if XD feature is supported or not, we just remove checking MSR_IA32_MISC_ENABLE(0x1A0). Cc: Anthony PERARD Cc: Jiewen Yao Cc: Feng Tian Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan Tested-by: Anthony PERARD Reviewed-by: Feng Tian --- diff --git a/UefiCpuPkg/CpuDxe/CpuPageTable.c b/UefiCpuPkg/CpuDxe/CpuPageTable.c index 65f607a90c..ab664b47d6 100644 --- a/UefiCpuPkg/CpuDxe/CpuPageTable.c +++ b/UefiCpuPkg/CpuDxe/CpuPageTable.c @@ -193,12 +193,9 @@ GetCurrentPagingContext ( AsmCpuid (0x80000001, NULL, NULL, NULL, &RegEdx); if ((RegEdx & BIT20) != 0) { // XD supported - if ((AsmReadMsr64 (0x000001A0) & BIT34) == 0) { - // XD enabled - if ((AsmReadMsr64 (0xC0000080) & BIT11) != 0) { - // XD activated - PagingContext->ContextData.Ia32.Attributes |= PAGE_TABLE_LIB_PAGING_CONTEXT_IA32_X64_ATTRIBUTES_XD_ACTIVATED; - } + if ((AsmReadMsr64 (0xC0000080) & BIT11) != 0) { + // XD activated + PagingContext->ContextData.Ia32.Attributes |= PAGE_TABLE_LIB_PAGING_CONTEXT_IA32_X64_ATTRIBUTES_XD_ACTIVATED; } } if ((RegEdx & BIT26) != 0) {