From nobody Fri Dec 27 03:41:57 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 150294146167337.8549922484965; Wed, 16 Aug 2017 20:44:21 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id A736021E2DA58; Wed, 16 Aug 2017 20:41:51 -0700 (PDT) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 AF51421E2DA48 for ; Wed, 16 Aug 2017 20:41:49 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP; 16 Aug 2017 20:44:16 -0700 Received: from ydong10-win10.ccr.corp.intel.com ([10.239.158.51]) by orsmga002.jf.intel.com with ESMTP; 16 Aug 2017 20:44:15 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,386,1498546800"; d="scan'208";a="124570786" From: Eric Dong To: edk2-devel@lists.01.org Date: Thu, 17 Aug 2017 11:44:12 +0800 Message-Id: <1502941453-12332-2-git-send-email-eric.dong@intel.com> X-Mailer: git-send-email 2.7.0.windows.1 In-Reply-To: <1502941453-12332-1-git-send-email-eric.dong@intel.com> References: <1502941453-12332-1-git-send-email-eric.dong@intel.com> Subject: [edk2] [Patch 1/2] UefiCpuPkg/CpuCommonFeaturesLib: Add CPUID MCA support check X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Kinney , Ruiyu Ni MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Add CPUID check to see if the CPU supports the Machine Check Architecture before accessing the Machine Check Architecture related MSRs. Cc: Michael Kinney Cc: Ruiyu Ni Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Eric Dong --- UefiCpuPkg/Library/CpuCommonFeaturesLib/Lmce.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/UefiCpuPkg/Library/CpuCommonFeaturesLib/Lmce.c b/UefiCpuPkg/Li= brary/CpuCommonFeaturesLib/Lmce.c index 65e5cd3..bf7e26b 100644 --- a/UefiCpuPkg/Library/CpuCommonFeaturesLib/Lmce.c +++ b/UefiCpuPkg/Library/CpuCommonFeaturesLib/Lmce.c @@ -41,6 +41,10 @@ LmceSupport ( { MSR_IA32_MCG_CAP_REGISTER McgCap; =20 + if (!McaSupport (ProcessorNumber, CpuInfo, ConfigData)) { + return FALSE; + } + McgCap.Uint64 =3D AsmReadMsr64 (MSR_IA32_MCG_CAP); if (ProcessorNumber =3D=3D 0) { DEBUG ((EFI_D_INFO, "LMCE eanble =3D %x\n", (BOOLEAN) (McgCap.Bits.MCG= _LMCE_P !=3D 0))); --=20 2.7.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel