From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com []) by mx.groups.io with SMTP id smtpd.web12.410.1577084160583910651 for ; Sun, 22 Dec 2019 22:56:02 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: liming.gao@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Dec 2019 22:56:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,346,1571727600"; d="scan'208";a="211454629" Received: from lgao4-mobl1.ccr.corp.intel.com ([10.255.29.23]) by orsmga008.jf.intel.com with ESMTP; 22 Dec 2019 22:56:00 -0800 From: "Liming Gao" To: devel@edk2.groups.io Cc: Jason Voelz , Ray Ni Subject: [Patch 2/2] UefiCpuPkg/CpuCommonFeaturesLib: SMXE bit of CR4 should set Date: Mon, 23 Dec 2019 14:55:37 +0800 Message-Id: <20191223065537.32468-3-liming.gao@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: <20191223065537.32468-1-liming.gao@intel.com> References: <20191223065537.32468-1-liming.gao@intel.com> From: Jason Voelz Add code to set SMXE in CR4 in the SmxInitialize flow when SMX is enabled. Signed-off-by: Jason Voelz Cc: Ray Ni --- UefiCpuPkg/Library/CpuCommonFeaturesLib/FeatureControl.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/UefiCpuPkg/Library/CpuCommonFeaturesLib/FeatureControl.c b/UefiCpuPkg/Library/CpuCommonFeaturesLib/FeatureControl.c index 38d3f53f56..b4474d2fab 100644 --- a/UefiCpuPkg/Library/CpuCommonFeaturesLib/FeatureControl.c +++ b/UefiCpuPkg/Library/CpuCommonFeaturesLib/FeatureControl.c @@ -240,6 +240,15 @@ SmxInitialize ( Status = RETURN_UNSUPPORTED; } + CPU_REGISTER_TABLE_WRITE_FIELD ( + ProcessorNumber, + ControlRegister, + 4, + IA32_CR4, + Bits.SMXE, + (State) ? 1 : 0 + ) + CPU_REGISTER_TABLE_TEST_THEN_WRITE_FIELD ( ProcessorNumber, Msr, -- 2.13.0.windows.1