summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/Library
diff options
context:
space:
mode:
authorZhiguang Liu <zhiguang.liu@intel.com>2024-05-28 09:52:06 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-07-24 02:47:34 +0000
commit76f441c57c6653d689fbe936ba494ebfdbc7cb4f (patch)
tree9c4c6d1b1909808206aeeb00c3346ec4f8284f6e /UefiCpuPkg/Library
parentf5901ff2a472a5418ee6ff790c3b86cf9c3f54f1 (diff)
downloadedk2-76f441c57c6653d689fbe936ba494ebfdbc7cb4f.tar.gz
edk2-76f441c57c6653d689fbe936ba494ebfdbc7cb4f.tar.bz2
edk2-76f441c57c6653d689fbe936ba494ebfdbc7cb4f.zip
UefiCpuPkg: Also exchange CPU_AP_DATA in SortApicId()
CPU_AP_DATA contains AP's information such as CpuHealthy and VolatileRegisters. Exchange the whole CPU_AP_DATA buffer instead some fields to make code more simple. Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
Diffstat (limited to 'UefiCpuPkg/Library')
-rw-r--r--UefiCpuPkg/Library/MpInitLib/MpLib.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c
index 1951922912..78eeaa6de2 100644
--- a/UefiCpuPkg/Library/MpInitLib/MpLib.c
+++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c
@@ -377,10 +377,9 @@ SortApicId (
UINTN Index3;
UINT32 ApicId;
CPU_INFO_IN_HOB CpuInfo;
+ CPU_AP_DATA CpuApData;
UINT32 ApCount;
CPU_INFO_IN_HOB *CpuInfoInHob;
- volatile UINT32 *StartupApSignal;
- VOID *SevEsSaveArea;
ApCount = CpuMpData->CpuCount - 1;
CpuInfoInHob = (CPU_INFO_IN_HOB *)(UINTN)CpuMpData->CpuInfoInHob;
@@ -407,18 +406,13 @@ SortApicId (
);
CopyMem (&CpuInfoInHob[Index1], &CpuInfo, sizeof (CPU_INFO_IN_HOB));
- //
- // Also exchange the StartupApSignal and SevEsSaveArea.
- //
- StartupApSignal = CpuMpData->CpuData[Index3].StartupApSignal;
- CpuMpData->CpuData[Index3].StartupApSignal =
- CpuMpData->CpuData[Index1].StartupApSignal;
- CpuMpData->CpuData[Index1].StartupApSignal = StartupApSignal;
-
- SevEsSaveArea = CpuMpData->CpuData[Index3].SevEsSaveArea;
- CpuMpData->CpuData[Index3].SevEsSaveArea =
- CpuMpData->CpuData[Index1].SevEsSaveArea;
- CpuMpData->CpuData[Index1].SevEsSaveArea = SevEsSaveArea;
+ CopyMem (&CpuApData, &CpuMpData->CpuData[Index3], sizeof (CPU_AP_DATA));
+ CopyMem (
+ &CpuMpData->CpuData[Index3],
+ &CpuMpData->CpuData[Index1],
+ sizeof (CPU_AP_DATA)
+ );
+ CopyMem (&CpuMpData->CpuData[Index1], &CpuApData, sizeof (CPU_AP_DATA));
}
}