UefiCpuPkg/MpInitLib: Swap local APIC timer interrupt state

We need to swap local APIC timer interrupt state between old BSP and new BSP.

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>
This commit is contained in:
Jeff Fan 2016-12-26 16:55:12 +08:00
parent a8d75a1802
commit 26b43433c1
1 changed files with 9 additions and 0 deletions

View File

@ -1512,7 +1512,13 @@ SwitchBSPWorker (
CPU_STATE State;
MSR_IA32_APIC_BASE_REGISTER ApicBaseMsr;
BOOLEAN OldInterruptState;
BOOLEAN OldTimerInterruptState;
//
// Save and Disable Local APIC timer interrupt
//
OldTimerInterruptState = GetApicTimerInterruptState ();
DisableApicTimerInterrupt ();
//
// Before send both BSP and AP to a procedure to exchange their roles,
// interrupt must be disabled. This is because during the exchange role
@ -1613,6 +1619,9 @@ SwitchBSPWorker (
//
SetInterruptState (OldInterruptState);
if (OldTimerInterruptState) {
EnableApicTimerInterrupt ();
}
return EFI_SUCCESS;
}