UefiCpuPkg/PiSmmCpuDxeSmm: Remove unnecessary function

Remove unnecessary function SetNotPresentPage(). We can directly
use ConvertMemoryPageAttributes to set a range to non-present.

Signed-off-by: Dun Tan <dun.tan@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Dun Tan
2023-04-07 13:23:01 +08:00
committed by Ray Ni
parent 4ceefd6dd1
commit f5c987fcac
3 changed files with 6 additions and 40 deletions

View File

@@ -1095,10 +1095,14 @@ PiCpuSmmEntry (
mSmmShadowStackSize
);
if (FeaturePcdGet (PcdCpuSmmStackGuard)) {
SetNotPresentPage (
ConvertMemoryPageAttributes (
Cr3,
mPagingMode,
(EFI_PHYSICAL_ADDRESS)(UINTN)Stacks + mSmmStackSize + EFI_PAGES_TO_SIZE (1) + (mSmmStackSize + mSmmShadowStackSize) * Index,
EFI_PAGES_TO_SIZE (1)
EFI_PAGES_TO_SIZE (1),
EFI_MEMORY_RP,
TRUE,
NULL
);
}
}