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>
CPU_STATE State;\r
MSR_IA32_APIC_BASE_REGISTER ApicBaseMsr;\r
BOOLEAN OldInterruptState;\r
+ BOOLEAN OldTimerInterruptState;\r
\r
+ //\r
+ // Save and Disable Local APIC timer interrupt\r
+ //\r
+ OldTimerInterruptState = GetApicTimerInterruptState ();\r
+ DisableApicTimerInterrupt ();\r
//\r
// Before send both BSP and AP to a procedure to exchange their roles,\r
// interrupt must be disabled. This is because during the exchange role\r
//\r
SetInterruptState (OldInterruptState);\r
\r
+ if (OldTimerInterruptState) {\r
+ EnableApicTimerInterrupt ();\r
+ }\r
\r
return EFI_SUCCESS;\r
}\r