summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32
diff options
context:
space:
mode:
authorJeff Fan <jeff.fan@intel.com>2017-04-01 19:39:22 +0800
committerJeff Fan <jeff.fan@intel.com>2017-04-07 09:43:48 +0800
commitb8caae191c6ae01a9cc73a2e38eb622f6732733d (patch)
treed65b4e1067a50e63ef225a3112e7fdfb45f93eba /UefiCpuPkg/PiSmmCpuDxeSmm/Ia32
parent1b2f7b3e4906fbee727677e827dacee7a9fc9b7f (diff)
downloadedk2-b8caae191c6ae01a9cc73a2e38eb622f6732733d.tar.gz
edk2-b8caae191c6ae01a9cc73a2e38eb622f6732733d.tar.bz2
edk2-b8caae191c6ae01a9cc73a2e38eb622f6732733d.zip
UefiCpuPkg/PiSmmCpuDxeSmm: Consume new APIs
Consuming PeCoffSerachImageBase() from PeCoffGetEntrypointLib and consuming DumpCpuContext() from CpuExceptionHandlerLib to replace its own implementation. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Diffstat (limited to 'UefiCpuPkg/PiSmmCpuDxeSmm/Ia32')
-rw-r--r--UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/PageTbl.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/PageTbl.c b/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/PageTbl.c
index 119810abc7..32ce5958c5 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/PageTbl.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/PageTbl.c
@@ -1,7 +1,7 @@
/** @file
Page table manipulation functions for IA-32 processors
-Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
This program and the accompanying materials
@@ -88,8 +88,8 @@ SmiDefaultPFHandler (
VOID
EFIAPI
SmiPFHandler (
- IN EFI_EXCEPTION_TYPE InterruptType,
- IN EFI_SYSTEM_CONTEXT SystemContext
+ IN EFI_EXCEPTION_TYPE InterruptType,
+ IN EFI_SYSTEM_CONTEXT SystemContext
)
{
UINTN PFAddress;
@@ -108,6 +108,7 @@ SmiPFHandler (
//
if ((PFAddress >= mCpuHotPlugData.SmrrBase) &&
(PFAddress < (mCpuHotPlugData.SmrrBase + mCpuHotPlugData.SmrrSize))) {
+ DumpCpuContext (InterruptType, SystemContext);
CpuIndex = GetCpuIndex ();
GuardPageAddress = (mSmmStackArrayBase + EFI_PAGE_SIZE + CpuIndex * mSmmStackSize);
if ((FeaturePcdGet (PcdCpuSmmStackGuard)) &&
@@ -115,15 +116,6 @@ SmiPFHandler (
(PFAddress < (GuardPageAddress + EFI_PAGE_SIZE))) {
DEBUG ((DEBUG_ERROR, "SMM stack overflow!\n"));
} else {
- DEBUG ((DEBUG_ERROR, "SMM exception data - 0x%x(", SystemContext.SystemContextIa32->ExceptionData));
- DEBUG ((DEBUG_ERROR, "I:%x, R:%x, U:%x, W:%x, P:%x",
- (SystemContext.SystemContextIa32->ExceptionData & IA32_PF_EC_ID) != 0,
- (SystemContext.SystemContextIa32->ExceptionData & IA32_PF_EC_RSVD) != 0,
- (SystemContext.SystemContextIa32->ExceptionData & IA32_PF_EC_US) != 0,
- (SystemContext.SystemContextIa32->ExceptionData & IA32_PF_EC_WR) != 0,
- (SystemContext.SystemContextIa32->ExceptionData & IA32_PF_EC_P) != 0
- ));
- DEBUG ((DEBUG_ERROR, ")\n"));
if ((SystemContext.SystemContextIa32->ExceptionData & IA32_PF_EC_ID) != 0) {
DEBUG ((DEBUG_ERROR, "SMM exception at execution (0x%x)\n", PFAddress));
DEBUG_CODE (
@@ -144,6 +136,7 @@ SmiPFHandler (
//
if ((PFAddress < mCpuHotPlugData.SmrrBase) ||
(PFAddress >= mCpuHotPlugData.SmrrBase + mCpuHotPlugData.SmrrSize)) {
+ DumpCpuContext (InterruptType, SystemContext);
if ((SystemContext.SystemContextIa32->ExceptionData & IA32_PF_EC_ID) != 0) {
DEBUG ((DEBUG_ERROR, "Code executed on IP(0x%x) out of SMM range after SMM is locked!\n", PFAddress));
DEBUG_CODE (
@@ -166,6 +159,7 @@ SmiPFHandler (
SystemContext.SystemContextIa32->ExceptionData
);
} else {
+ DumpCpuContext (InterruptType, SystemContext);
SmiDefaultPFHandler ();
}