summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/Library
diff options
context:
space:
mode:
authorJeff Fan <jeff.fan@intel.com>2016-12-26 16:55:12 +0800
committerJeff Fan <jeff.fan@intel.com>2016-12-28 15:38:12 +0800
commit26b43433c1367f893ce3ae962761141a93b1d25a (patch)
treeb42630ddf99666a7f056b5720f760bb8e0135ef2 /UefiCpuPkg/Library
parenta8d75a1802df015a79d929f45972de98b9a0a2d9 (diff)
downloadedk2-26b43433c1367f893ce3ae962761141a93b1d25a.tar.gz
edk2-26b43433c1367f893ce3ae962761141a93b1d25a.tar.bz2
edk2-26b43433c1367f893ce3ae962761141a93b1d25a.zip
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>
Diffstat (limited to 'UefiCpuPkg/Library')
-rw-r--r--UefiCpuPkg/Library/MpInitLib/MpLib.c9
1 files changed, 9 insertions, 0 deletions
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,8 +1512,14 @@ 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
// process, 2 CPU may use 1 stack. If interrupt happens, the stack will
@@ -1613,6 +1619,9 @@ SwitchBSPWorker (
//
SetInterruptState (OldInterruptState);
+ if (OldTimerInterruptState) {
+ EnableApicTimerInterrupt ();
+ }
return EFI_SUCCESS;
}