]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c
UefiCpuPkg PiSmmCpuDxeSmm: SMM profile and static paging mutual exclusion
[mirror_edk2.git] / UefiCpuPkg / PiSmmCpuDxeSmm / X64 / PageTbl.c
index 6478c6c3e355e28afa0c46af94538ef61b11ec8a..0fe944fc18cc9402c0217110ba723363ec0ae855 100644 (file)
@@ -919,17 +919,24 @@ SetPageTableAttributes (
   //\r
   // Don't do this if\r
   //  - no static page table; or\r
-  //  - SMM heap guard feature enabled\r
+  //  - SMM heap guard feature enabled; or\r
   //      BIT2: SMM page guard enabled\r
   //      BIT3: SMM pool guard enabled\r
+  //  - SMM profile feature enabled\r
   //\r
   if (!mCpuSmmStaticPageTable ||\r
-      (PcdGet8 (PcdHeapGuardPropertyMask) & (BIT3 | BIT2)) != 0) {\r
+      ((PcdGet8 (PcdHeapGuardPropertyMask) & (BIT3 | BIT2)) != 0) ||\r
+      FeaturePcdGet (PcdCpuSmmProfileEnable)) {\r
     //\r
-    // Static paging and heap guard should not be enabled at the same time.\r
+    // Static paging and heap guard could not be enabled at the same time.\r
     //\r
     ASSERT (!(mCpuSmmStaticPageTable &&\r
               (PcdGet8 (PcdHeapGuardPropertyMask) & (BIT3 | BIT2)) != 0));\r
+\r
+    //\r
+    // Static paging and SMM profile could not be enabled at the same time.\r
+    //\r
+    ASSERT (!(mCpuSmmStaticPageTable && FeaturePcdGet (PcdCpuSmmProfileEnable)));\r
     return ;\r
   }\r
 \r