]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg/MpInitLib: Update AP information when BSP switched
authorJeff Fan <jeff.fan@intel.com>
Mon, 14 Nov 2016 03:43:26 +0000 (11:43 +0800)
committerJeff Fan <jeff.fan@intel.com>
Wed, 16 Nov 2016 08:28:22 +0000 (16:28 +0800)
When BSP switched, we need to update some AP information. For example,
ApStartupSignalBuffer and ApTopOfStack.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael D Kinney <michael.d.kinney@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
UefiCpuPkg/Library/MpInitLib/MpLib.h

index fd32482d5515413044fa46821dd9b000cd471a4e..3c2e6d6b89d98ecc09901a48c4757db3646acd46 100644 (file)
@@ -549,6 +549,8 @@ ApWakeupFunction (
             GetProcessorNumber (CpuMpData, &ProcessorNumber);\r
             CpuMpData->CpuData[ProcessorNumber].ApFunction = 0;\r
             CpuMpData->CpuData[ProcessorNumber].ApFunctionArgument = 0;\r
+            ApStartupSignalBuffer = CpuMpData->CpuData[ProcessorNumber].StartupApSignal;\r
+            CpuInfoInHob[ProcessorNumber].ApTopOfStack = CpuInfoInHob[CpuMpData->NewBspNumber].ApTopOfStack;\r
           } else {\r
             //\r
             // Re-get the CPU APICID and Initial APICID\r
@@ -1420,6 +1422,7 @@ SwitchBSPWorker (
   CpuMpData->BSPInfo.State = CPU_SWITCH_STATE_IDLE;\r
   CpuMpData->APInfo.State  = CPU_SWITCH_STATE_IDLE;\r
   CpuMpData->SwitchBspFlag = TRUE;\r
+  CpuMpData->NewBspNumber  = ProcessorNumber;\r
 \r
   //\r
   // Clear the BSP bit of MSR_IA32_APIC_BASE\r
index f81c819c3445a6c15cbca9e409d1f9d2b270cef4..0ac777a099b13ee179053e848f056579a70f7bb9 100644 (file)
@@ -216,6 +216,7 @@ struct _CPU_MP_DATA {
   AP_INIT_STATE                  InitFlag;\r
   BOOLEAN                        X2ApicEnable;\r
   BOOLEAN                        SwitchBspFlag;\r
+  UINTN                          NewBspNumber;\r
   CPU_EXCHANGE_ROLE_INFO         BSPInfo;\r
   CPU_EXCHANGE_ROLE_INFO         APInfo;\r
   MTRR_SETTINGS                  MtrrTable;\r