On 11/17/23 08:01, Ni, Ray wrote: > Laszlo, > I agree that the BSP's XD status is saved in both CpuMpData and > ExchangeInfo. > But, thinking from another perspective, ExchangeInfo is "only" used by > the assembly > code. That's why the BSP code needs to save the XD status in CpuMpData > and ExchangeInfo. > > If we remove the XD status field in ExchangeInfo, then the assembly code > has to understand > the structure layout of CpuMpData, which is what I prefer to avoid. > > If you compare all fields in ExchangeInfo and CpuMpData, following > fields are already duplicated: > * CpuMpData.CpuInfoHob <-> MpExchangeInfo.CpuInfo > * InitFlag > * SevEsIsEnabled > * SevSnpIsEnabled > * GhcbBase > > > So, I prefer to keep the current change proposed in Yuanhao's patch.
Very good explanation, thank you. Can we perhaps document, in an additional patch: - in "UefiCpuPkg/Library/MpInitLib/MpEqu.inc", that the assembly routines are not supposed to access the internals of CPU_MP_DATA, - the same statement above "struct _CPU_MP_DATA" in "UefiCpuPkg/Library/MpInitLib/MpLib.h"? A number of structures in "UefiCpuPkg/Library/MpInitLib/MpLib.h" document whether they are to be used by assembly code vs. C code (vs. both), but CPU_MP_DATA doesn't seem to have such comments. For the current patch: Reviewed-by: Laszlo Ersek <ler...@redhat.com> Thanks! Laszlo -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111340): https://edk2.groups.io/g/devel/message/111340 Mute This Topic: https://groups.io/mt/102556608/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-