From: Jason Voelz <jason.vo...@intel.com>

Add code to set SMXE in CR4 in the SmxInitialize flow when SMX is enabled.

Signed-off-by: Jason Voelz <jason.vo...@intel.com>
Cc: Ray Ni <ray...@intel.com>
---
 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


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#52495): https://edk2.groups.io/g/devel/message/52495
Mute This Topic: https://groups.io/mt/69226211/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to