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