summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Fan <jeff.fan@intel.com>2016-11-16 22:25:56 +0800
committerJeff Fan <jeff.fan@intel.com>2016-11-18 09:43:52 +0800
commit5c88af795dadb81c9fe43af813b7b6d69bc5e0e4 (patch)
treee710b4f44f72473cf901089f043e27c1af6d6032
parent0e99d51637dee0940a23556f3aee2e7c89bd016f (diff)
downloadedk2-platforms-5c88af795dadb81c9fe43af813b7b6d69bc5e0e4.tar.xz
MdeModulePkg/PiSmmCpuDxeSmm: Check RegisterCpuInterruptHandler status
Once platform selects the incorrect instance, the caller could know it from return status and ASSERT(). Cc: Feng Tian <feng.tian@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
-rw-r--r--UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/PageTbl.c4
-rw-r--r--UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c5
-rw-r--r--UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c4
3 files changed, 10 insertions, 3 deletions
diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/PageTbl.c b/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/PageTbl.c
index 65f09e5622..5033bc50d7 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/PageTbl.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/PageTbl.c
@@ -27,6 +27,7 @@ SmmInitPageTable (
{
UINTN PageFaultHandlerHookAddress;
IA32_IDT_GATE_DESCRIPTOR *IdtEntry;
+ EFI_STATUS Status;
//
// Initialize spin lock
@@ -49,7 +50,8 @@ SmmInitPageTable (
//
// Register SMM Page Fault Handler
//
- SmmRegisterExceptionHandler (&mSmmCpuService, EXCEPT_IA32_PAGE_FAULT, SmiPFHandler);
+ Status = SmmRegisterExceptionHandler (&mSmmCpuService, EXCEPT_IA32_PAGE_FAULT, SmiPFHandler);
+ ASSERT_EFI_ERROR (Status);
}
//
diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c
index 4b7fad29c3..c1a48d100e 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c
@@ -1375,5 +1375,8 @@ InitIdtr (
VOID
)
{
- SmmRegisterExceptionHandler (&mSmmCpuService, EXCEPT_IA32_DEBUG, DebugExceptionHandler);
+ EFI_STATUS Status;
+
+ Status = SmmRegisterExceptionHandler (&mSmmCpuService, EXCEPT_IA32_DEBUG, DebugExceptionHandler);
+ ASSERT_EFI_ERROR (Status);
}
diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c
index b3e50a4f20..531e188215 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c
@@ -244,6 +244,7 @@ SmmInitPageTable (
UINTN Index;
UINTN PageFaultHandlerHookAddress;
IA32_IDT_GATE_DESCRIPTOR *IdtEntry;
+ EFI_STATUS Status;
//
// Initialize spin lock
@@ -315,7 +316,8 @@ SmmInitPageTable (
//
// Register Smm Page Fault Handler
//
- SmmRegisterExceptionHandler (&mSmmCpuService, EXCEPT_IA32_PAGE_FAULT, SmiPFHandler);
+ Status = SmmRegisterExceptionHandler (&mSmmCpuService, EXCEPT_IA32_PAGE_FAULT, SmiPFHandler);
+ ASSERT_EFI_ERROR (Status);
}
//