diff options
author | Star Zeng <star.zeng@intel.com> | 2017-12-28 10:24:29 +0800 |
---|---|---|
committer | Ruiyu Ni <ruiyu.ni@intel.com> | 2018-01-26 19:11:23 +0800 |
commit | bafa76ef5bf21d70f5b709154f6ecaaea11fb759 (patch) | |
tree | 26abe5b41a54a0fc81c6f4f821f343aa48069c98 | |
parent | 7230212a43856a8964f88a88678e954bcbd03087 (diff) | |
download | edk2-bafa76ef5bf21d70f5b709154f6ecaaea11fb759.zip edk2-bafa76ef5bf21d70f5b709154f6ecaaea11fb759.tar.gz edk2-bafa76ef5bf21d70f5b709154f6ecaaea11fb759.tar.bz2 |
UefiCpuPkg/MpInitLib: Make sure AP uses correct StartupApSignal
Every processor's StartupApSignal is initialized in
MpInitLibInitialize() before calling CollectProcessorCount().
When SortApicId() is called from CollectProcessorCount(), AP Index
is re-assigned by APIC ID. But SortApicId() forgets to set the
correct StartupApSignal when sorting the AP.
The patch fixes this issue.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
-rw-r--r-- | UefiCpuPkg/Library/MpInitLib/MpLib.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c index 42011d6..742f0c1 100644 --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c @@ -330,6 +330,7 @@ SortApicId ( CPU_INFO_IN_HOB CpuInfo;
UINT32 ApCount;
CPU_INFO_IN_HOB *CpuInfoInHob;
+ volatile UINT32 *StartupApSignal;
ApCount = CpuMpData->CpuCount - 1;
CpuInfoInHob = (CPU_INFO_IN_HOB *) (UINTN) CpuMpData->CpuInfoInHob;
@@ -354,6 +355,14 @@ SortApicId ( sizeof (CPU_INFO_IN_HOB)
);
CopyMem (&CpuInfoInHob[Index1], &CpuInfo, sizeof (CPU_INFO_IN_HOB));
+
+ //
+ // Also exchange the StartupApSignal.
+ //
+ StartupApSignal = CpuMpData->CpuData[Index3].StartupApSignal;
+ CpuMpData->CpuData[Index3].StartupApSignal =
+ CpuMpData->CpuData[Index1].StartupApSignal;
+ CpuMpData->CpuData[Index1].StartupApSignal = StartupApSignal;
}
}
|