From: Ni, Ruiyu Date: Mon, 2 Jul 2018 06:01:35 +0000 (+0800) Subject: UefiCpuPkg/MpInitLib: Avoid calling PEI services from AP X-Git-Tag: edk2-stable201903~1425 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=c563077a380437c114aba4c95be65eb963ebc1f3;hp=c563077a380437c114aba4c95be65eb963ebc1f3 UefiCpuPkg/MpInitLib: Avoid calling PEI services from AP Today's MpInitLib PEI implementation directly calls PeiServices->GetHobList() from AP which may cause racing issue. This patch fixes this issue by duplicating IDT for APs. Because CpuMpData structure is stored just after IDT, the CpuMPData address equals to IDTR.BASE + IDTR.LIMIT + 1. v2: 1. Add ALIGN_VALUE() on BufferSize. 2. Add ASSERT() to make sure no memory usage outside of the allocated buffer. 3. Add more comments in InitConfig path when restoring CpuData[0].VolatileRegisters. Cc: Jeff Fan Cc: Eric Dong Cc: Jiewen Yao Cc: Fish Andrew Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni Reviewed-by: Eric Dong Acked-by: Laszlo Ersek Tested-by: Laszlo Ersek ---