]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c
UefiCpuPkg: Not touch SmmFeatureControl if Code_Access_Chk not Set
[mirror_edk2.git] / UefiCpuPkg / PiSmmCpuDxeSmm / PiSmmCpuDxeSmm.c
index de681c0a30698ac0c300d072768533a7d68a32b4..532ac0974b7de7d48e6f3c9d8dcb8b106d28404f 100644 (file)
@@ -1309,9 +1309,9 @@ ConfigSmmCodeAccessCheckOnCurrentProcessor (
   NewSmmFeatureControlMsr = SmmFeatureControlMsr;\r
   if (mSmmCodeAccessCheckEnable) {\r
     NewSmmFeatureControlMsr |= SMM_CODE_CHK_EN_BIT;\r
-  }\r
-  if (FeaturePcdGet (PcdCpuSmmFeatureControlMsrLock)) {\r
-    NewSmmFeatureControlMsr |= SMM_FEATURE_CONTROL_LOCK_BIT;\r
+    if (FeaturePcdGet (PcdCpuSmmFeatureControlMsrLock)) {\r
+      NewSmmFeatureControlMsr |= SMM_FEATURE_CONTROL_LOCK_BIT;\r
+    }\r
   }\r
 \r
   //\r
@@ -1354,13 +1354,6 @@ ConfigSmmCodeAccessCheck (
   //\r
   if ((AsmReadMsr64 (EFI_MSR_SMM_MCA_CAP) & SMM_CODE_ACCESS_CHK_BIT) == 0) {\r
     mSmmCodeAccessCheckEnable = FALSE;\r
-  }\r
-\r
-  //\r
-  // If the SMM Code Access Check feature is disabled and the Feature Control MSR\r
-  // is not being locked, then no additional work is required\r
-  //\r
-  if (!mSmmCodeAccessCheckEnable && !FeaturePcdGet (PcdCpuSmmFeatureControlMsrLock)) {\r
     return;\r
   }\r
 \r