From cff06413604a980bd3f04782c4a745f7c02ccd7b Mon Sep 17 00:00:00 2001 From: Dun Tan Date: Thu, 1 Aug 2024 09:53:20 +0800 Subject: UefiCpuPkg: remove unneeded code in SmmProfilePFHandler Remove unneeded calling of SmmProfileMapPFAddress () in SmmProfileMapPFAddress if SMM profile is not started. Previously, before SMM profile is started at ReadyToLock, SMM page table only covers [0, 4G]. The access to the range above 4G will cause PF. SmmProfileMapPFAddress is needed here to map the PF address before SMM profile is started. Now we always create full mapping SMM page table in the SmmInitPageTable(). When SMM profile is enabled, before SMM profile is started at ReadyToLock, SMM page table covers [0, MaxSupportedPhysicalAddress]. So the case that access to the range above 4G causes PF won't happen anymore. Then we can remove the calling of SmmProfileMapPFAddress before SMM profile is started. Signed-off-by: Dun Tan --- UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c index 351afc9638..2dd166d39c 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c @@ -1333,14 +1333,6 @@ SmmProfilePFHandler ( UINT8 SoftSmiValue; EFI_SMM_SAVE_STATE_IO_INFO IoInfo; - if (!mSmmProfileStart) { - // - // If SMM profile does not start, call original page fault handler. - // - SmmProfileMapPFAddress (); - return; - } - if (mBtsSupported) { DisableBTS (); } -- cgit