From 26b43433c1367f893ce3ae962761141a93b1d25a Mon Sep 17 00:00:00 2001 From: Jeff Fan Date: Mon, 26 Dec 2016 16:55:12 +0800 Subject: 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 Cc: Kinney Michael D Cc: Ruiyu Ni Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan Reviewed-by: Feng Tian --- UefiCpuPkg/Library/MpInitLib/MpLib.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c index 9dae827306..77d855a29a 100644 --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c @@ -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; } -- cgit v1.2.3