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>
This commit is contained in:
Jeff Fan 2016-11-16 22:25:56 +08:00
parent 0e99d51637
commit 5c88af795d
3 changed files with 10 additions and 3 deletions

View File

@ -27,6 +27,7 @@ SmmInitPageTable (
{ {
UINTN PageFaultHandlerHookAddress; UINTN PageFaultHandlerHookAddress;
IA32_IDT_GATE_DESCRIPTOR *IdtEntry; IA32_IDT_GATE_DESCRIPTOR *IdtEntry;
EFI_STATUS Status;
// //
// Initialize spin lock // Initialize spin lock
@ -49,7 +50,8 @@ SmmInitPageTable (
// //
// Register SMM Page Fault Handler // Register SMM Page Fault Handler
// //
SmmRegisterExceptionHandler (&mSmmCpuService, EXCEPT_IA32_PAGE_FAULT, SmiPFHandler); Status = SmmRegisterExceptionHandler (&mSmmCpuService, EXCEPT_IA32_PAGE_FAULT, SmiPFHandler);
ASSERT_EFI_ERROR (Status);
} }
// //

View File

@ -1375,5 +1375,8 @@ InitIdtr (
VOID VOID
) )
{ {
SmmRegisterExceptionHandler (&mSmmCpuService, EXCEPT_IA32_DEBUG, DebugExceptionHandler); EFI_STATUS Status;
Status = SmmRegisterExceptionHandler (&mSmmCpuService, EXCEPT_IA32_DEBUG, DebugExceptionHandler);
ASSERT_EFI_ERROR (Status);
} }

View File

@ -244,6 +244,7 @@ SmmInitPageTable (
UINTN Index; UINTN Index;
UINTN PageFaultHandlerHookAddress; UINTN PageFaultHandlerHookAddress;
IA32_IDT_GATE_DESCRIPTOR *IdtEntry; IA32_IDT_GATE_DESCRIPTOR *IdtEntry;
EFI_STATUS Status;
// //
// Initialize spin lock // Initialize spin lock
@ -315,7 +316,8 @@ SmmInitPageTable (
// //
// Register Smm Page Fault Handler // Register Smm Page Fault Handler
// //
SmmRegisterExceptionHandler (&mSmmCpuService, EXCEPT_IA32_PAGE_FAULT, SmiPFHandler); Status = SmmRegisterExceptionHandler (&mSmmCpuService, EXCEPT_IA32_PAGE_FAULT, SmiPFHandler);
ASSERT_EFI_ERROR (Status);
} }
// //