summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDun Tan <dun.tan@intel.com>2024-07-25 13:56:37 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-08-05 06:59:09 +0000
commitb5c9bbff8e9c2613dc72ab4dde6d4ddc1e1217bd (patch)
tree8d7106e9742890568fe3aa6faa2f7067fcbea5e5
parentb3631ca944bda812f51db3f833f18d82d8e0e761 (diff)
downloadedk2-b5c9bbff8e9c2613dc72ab4dde6d4ddc1e1217bd.tar.gz
edk2-b5c9bbff8e9c2613dc72ab4dde6d4ddc1e1217bd.tar.bz2
edk2-b5c9bbff8e9c2613dc72ab4dde6d4ddc1e1217bd.zip
UefiCpuPkg:CpuDeadLoop in SmiPFHandler if SMM profile is disabled
Always call CpuDeadLoop() in SmiPFHandler if SMM profile is disabled. Previously, when PcdCpuSmmRestrictedMemoryAccess is FALSE, SMM page table only covers [0, 4g]. When code access to range above 4g happens, SmiPFHandler will map the accessed not-present range to present. After we always create full mapping page table, the dynamic page table creation logic is only needed when SMM profile is enabled. So we use CpuDeadLoop() in SmiPFHandler to cover the all the PF exception when SMM profile is disabled Considering that [0, 4g] is always mapped in SMM page table, we also modify the IA32 SmiPFHandler code to be aligned with X64 code. Signed-off-by: Dun Tan <dun.tan@intel.com>
-rw-r--r--UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/PageTbl.c2
-rw-r--r--UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/PageTbl.c b/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/PageTbl.c
index 5c00c0fa8c..5170be342f 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/PageTbl.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/PageTbl.c
@@ -212,7 +212,7 @@ SmiPFHandler (
);
} else {
DumpCpuContext (InterruptType, SystemContext);
- SmiDefaultPFHandler ();
+ CpuDeadLoop ();
}
Exit:
diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c
index a7b02981dc..09a9c1c49f 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c
@@ -1,7 +1,7 @@
/** @file
Page Fault (#PF) handler for X64 processors
-Copyright (c) 2009 - 2023, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2009 - 2024, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -982,7 +982,8 @@ SmiPFHandler (
SystemContext.SystemContextX64->ExceptionData
);
} else {
- SmiDefaultPFHandler ();
+ DumpCpuContext (InterruptType, SystemContext);
+ CpuDeadLoop ();
}
Exit: