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>
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
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