]> xenbits.xensource.com Git - people/aperard/ovmf.git/commitdiff
UefiCpuPkg/PiSmmCpuDxeSmm: Correct SetPageTableAttributes func usage
authorJiaxin Wu <jiaxin.wu@intel.com>
Mon, 2 Sep 2024 04:22:41 +0000 (12:22 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fri, 6 Sep 2024 08:41:49 +0000 (08:41 +0000)
SetPageTableAttributes() will use the IfReadOnlyPageTableNeeded() to
determine whether it is necessary to set the page table itself to
read-only. And IfReadOnlyPageTableNeeded() has already token into
account the status of IsRestrictedMemoryAccess(). Therefore, there
is no need for an additional call to IsRestrictedMemoryAccess()
before calling the SetPageTableAttributes().

Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c
UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuStandaloneMm.c

index 50aeefb9484e8eeef6d8734487a4c6791429624b..0ecdd2d8910d1ba396b76c22d955b6f46090d6a1 100644 (file)
@@ -95,12 +95,10 @@ PerformRemainingTasks (
       SetMemMapAttributes (MemoryAttributesTable);\r
     }\r
 \r
-    if (IsRestrictedMemoryAccess ()) {\r
-      //\r
-      // Set page table itself to be read-only\r
-      //\r
-      SetPageTableAttributes ();\r
-    }\r
+    //\r
+    // Set page table itself to be read-only\r
+    //\r
+    SetPageTableAttributes ();\r
 \r
     //\r
     // Configure SMM Code Access Check feature if available.\r
index f81389463fc772ba15b4bbe1307f9539321db882..6f59b493051a3c89f2f0c3ff6b6444dcaba40d43 100644 (file)
@@ -70,12 +70,10 @@ PerformRemainingTasks (
       SetMemMapAttributes (MemoryAttributesTable);\r
     }\r
 \r
-    if (IsRestrictedMemoryAccess ()) {\r
-      //\r
-      // Set page table itself to be read-only\r
-      //\r
-      SetPageTableAttributes ();\r
-    }\r
+    //\r
+    // Set page table itself to be read-only\r
+    //\r
+    SetPageTableAttributes ();\r
 \r
     //\r
     // Measure performance of SmmCpuFeaturesCompleteSmmReadyToLock() from caller side\r