diff options
author | Jeff Fan <jeff.fan@intel.com> | 2016-12-26 16:52:48 +0800 |
---|---|---|
committer | Jeff Fan <jeff.fan@intel.com> | 2016-12-28 15:38:07 +0800 |
commit | a8d75a1802df015a79d929f45972de98b9a0a2d9 (patch) | |
tree | 287c38aa1e2dae524ccd262a769266497b211cb9 /UefiCpuPkg/Library/MpInitLib/DxeMpLib.c | |
parent | ffab244280fd934c9a02142765e40f70fbc061a1 (diff) | |
download | edk2-a8d75a1802df015a79d929f45972de98b9a0a2d9.tar.gz edk2-a8d75a1802df015a79d929f45972de98b9a0a2d9.tar.bz2 edk2-a8d75a1802df015a79d929f45972de98b9a0a2d9.zip |
UefiCpuPkg/MpInitLib: Move save/restore interrupt to SwitchBSPWorker()
During switching BSP phase, we need to disable CPU interruput to prevent stack
crashed by Timer interrupt handle. But when we enabled source debugging feature,
debug timer interrupt handler (existing on both PEI and DXE) also could crash
the stack used during switching BSP. So,we need to move save/restore interrupt
to SwitchBSPWorker().
Cc: Feng Tian <feng.tian@intel.com>
Cc: Kinney Michael D <michael.d.kinney@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Diffstat (limited to 'UefiCpuPkg/Library/MpInitLib/DxeMpLib.c')
-rw-r--r-- | UefiCpuPkg/Library/MpInitLib/DxeMpLib.c | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c b/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c index 1204abd577..733a9fb7be 100644 --- a/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c +++ b/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c @@ -646,29 +646,10 @@ MpInitLibSwitchBSP ( )
{
EFI_STATUS Status;
- BOOLEAN OldInterruptState;
- //
- // Before send both BSP and AP to a procedure to exchange their roles,
- // interrupt must be disabled. This is because during the exchange role
- // process, 2 CPU may use 1 stack. If interrupt happens, the stack will
- // be corrupted, since interrupt return address will be pushed to stack
- // by hardware.
- //
- OldInterruptState = SaveAndDisableInterrupts ();
-
- //
- // Mask LINT0 & LINT1 for the old BSP
- //
- DisableLvtInterrupts ();
Status = SwitchBSPWorker (ProcessorNumber, EnableOldBSP);
- //
- // Restore interrupt state.
- //
- SetInterruptState (OldInterruptState);
-
return Status;
}
|