]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c
UefiCpuPkg/PiSmmCpu: Restrict access per PcdCpuSmmRestrictedMemoryAccess
[mirror_edk2.git] / UefiCpuPkg / PiSmmCpuDxeSmm / PiSmmCpuDxeSmm.c
index 69a04dfb2311b65699ff51efffc643bd1ba4767d..723fd5042ff47f6ae36ccda21721338852e7ddeb 100644 (file)
@@ -1431,15 +1431,17 @@ PerformRemainingTasks (
     //\r
     SetMemMapAttributes ();\r
 \r
-    //\r
-    // For outside SMRAM, we only map SMM communication buffer or MMIO.\r
-    //\r
-    SetUefiMemMapAttributes ();\r
+    if (IsRestrictedMemoryAccess ()) {\r
+      //\r
+      // For outside SMRAM, we only map SMM communication buffer or MMIO.\r
+      //\r
+      SetUefiMemMapAttributes ();\r
 \r
-    //\r
-    // Set page table itself to be read-only\r
-    //\r
-    SetPageTableAttributes ();\r
+      //\r
+      // Set page table itself to be read-only\r
+      //\r
+      SetPageTableAttributes ();\r
+    }\r
 \r
     //\r
     // Configure SMM Code Access Check feature if available.\r