Skip to content

Commit

Permalink
UefiCpuPkg: remove unneeded code in SmmProfilePFHandler
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
td36 authored and mergify[bot] committed Aug 5, 2024
1 parent 8b8ac5d commit cff0641
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ();
}
Expand Down

0 comments on commit cff0641

Please sign in to comment.