]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg/MpInitLib: Swap local APIC timer interrupt state
authorJeff Fan <jeff.fan@intel.com>
Mon, 26 Dec 2016 08:55:12 +0000 (16:55 +0800)
committerJeff Fan <jeff.fan@intel.com>
Wed, 28 Dec 2016 07:38:12 +0000 (15:38 +0800)
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>
UefiCpuPkg/Library/MpInitLib/MpLib.c

index 9dae827306d50f392679de78f210345cb0208c97..77d855a29a96eaf1212dd0b77dc99aca4c925501 100644 (file)
@@ -1512,7 +1512,13 @@ SwitchBSPWorker (
   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
@@ -1613,6 +1619,9 @@ SwitchBSPWorker (
   //\r
   SetInterruptState (OldInterruptState);\r
 \r
+  if (OldTimerInterruptState) {\r
+    EnableApicTimerInterrupt ();\r
+  }\r
 \r
   return EFI_SUCCESS;\r
 }\r