diff options
author | Jiaxin Wu <jiaxin.wu@intel.com> | 2024-09-02 13:37:51 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2024-09-06 08:41:49 +0000 |
commit | 633a755d99d8f889c4e3ed74cf558b16e6a67251 (patch) | |
tree | 57e7c9ae09d35e9aef8b31dc67ede4736f8bd2ea /UefiCpuPkg | |
parent | 4f6614fc180c3f24a72ac3234daba8575f13cbad (diff) | |
download | edk2-633a755d99d8f889c4e3ed74cf558b16e6a67251.tar.gz |
UefiCpuPkg/PiSmmCpuDxeSmm: Update IfReadOnlyPageTableNeeded
After the 9f29fbd3, full mapping SMM page table is always created
regardless the value of the PcdCpuSmmRestrictedMemoryAccess. If so,
SMM PageTable Attributes can be set to ready-only since there is no
need to update it. So, this patch is to remove restricted memory
access check when setting the SMM PageTable attributes.
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Diffstat (limited to 'UefiCpuPkg')
-rw-r--r-- | UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c index d1cfd72106..9c2fe162a9 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c @@ -1486,31 +1486,14 @@ IfReadOnlyPageTableNeeded ( {
//
// Don't mark page table memory as read-only if
- // - no restriction on access to non-SMRAM memory; or
// - SMM heap guard feature enabled; or
// BIT2: SMM page guard enabled
// BIT3: SMM pool guard enabled
// - SMM profile feature enabled
//
- if (!IsRestrictedMemoryAccess () ||
- ((PcdGet8 (PcdHeapGuardPropertyMask) & (BIT3 | BIT2)) != 0) ||
+ if (((PcdGet8 (PcdHeapGuardPropertyMask) & (BIT3 | BIT2)) != 0) ||
mSmmProfileEnabled)
{
- if (sizeof (UINTN) == sizeof (UINT64)) {
- //
- // Restriction on access to non-SMRAM memory and heap guard could not be enabled at the same time.
- //
- ASSERT (
- !(IsRestrictedMemoryAccess () &&
- (PcdGet8 (PcdHeapGuardPropertyMask) & (BIT3 | BIT2)) != 0)
- );
-
- //
- // Restriction on access to non-SMRAM memory and SMM profile could not be enabled at the same time.
- //
- ASSERT (!(IsRestrictedMemoryAccess () && mSmmProfileEnabled));
- }
-
return FALSE;
}
|