From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from SMTP02.CITRIX.COM (smtp02.citrix.com [66.165.176.63]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9D622803AC for ; Wed, 15 Mar 2017 08:50:45 -0700 (PDT) X-IronPort-AV: E=Sophos;i="5.36,169,1486425600"; d="scan'208";a="422761822" Date: Wed, 15 Mar 2017 15:50:19 +0000 From: Anthony PERARD To: Jeff Fan CC: , Jiewen Yao , Feng Tian Message-ID: <20170315155019.GB1882@perard.uk.xensource.com> References: <20170315015430.4800-1-jeff.fan@intel.com> MIME-Version: 1.0 In-Reply-To: <20170315015430.4800-1-jeff.fan@intel.com> User-Agent: Mutt/1.8.0 (2017-02-23) Subject: Re: [PATCH] UefiCpuPkg/CpuDxe: Remove MSR_IA32_MISC_ENABLE check X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Mar 2017 15:50:46 -0000 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline On Wed, Mar 15, 2017 at 09:54:30AM +0800, Jeff Fan wrote: > 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 Thanks, that works for me. I've tested on AMD and Intel machine, with Xen. Tested-by: Anthony PERARD > --- > UefiCpuPkg/CpuDxe/CpuPageTable.c | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) > > diff --git a/UefiCpuPkg/CpuDxe/CpuPageTable.c b/UefiCpuPkg/CpuDxe/CpuPageTable.c > index 65f607a..ab664b4 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) { > -- > 2.9.3.windows.2 > -- Anthony PERARD