From 1f0d8096291651e6c20dbbc57d108321c1443563 Mon Sep 17 00:00:00 2001 From: Jason Voelz Date: Mon, 23 Dec 2019 14:55:37 +0800 Subject: [PATCH] UefiCpuPkg/CpuCommonFeaturesLib: SMXE bit of CR4 should set Add code to set SMXE in CR4 in the SmxInitialize flow when SMX is enabled. Signed-off-by: Jason Voelz Cc: Ray Ni Reviewed-by: 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,