UefiCpuPkg/PiSmmCpuDxeSmm: Correct SetPageTableAttributes func usage

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>
This commit is contained in:
Jiaxin Wu 2024-09-02 12:22:41 +08:00 committed by mergify[bot]
parent f6eb069e17
commit 4f6614fc18
2 changed files with 8 additions and 12 deletions

View File

@ -95,12 +95,10 @@ PerformRemainingTasks (
SetMemMapAttributes (MemoryAttributesTable);
}
if (IsRestrictedMemoryAccess ()) {
//
// Set page table itself to be read-only
//
SetPageTableAttributes ();
}
//
// Set page table itself to be read-only
//
SetPageTableAttributes ();
//
// Configure SMM Code Access Check feature if available.

View File

@ -70,12 +70,10 @@ PerformRemainingTasks (
SetMemMapAttributes (MemoryAttributesTable);
}
if (IsRestrictedMemoryAccess ()) {
//
// Set page table itself to be read-only
//
SetPageTableAttributes ();
}
//
// Set page table itself to be read-only
//
SetPageTableAttributes ();
//
// Measure performance of SmmCpuFeaturesCompleteSmmReadyToLock() from caller side