Hi Ray and Laszlo,

Thanks a lot for the feedbacks.

Please have a review on the patch v6 which:

-Kept execute disable bit both in MpExchangeInfo and CpuMpData.
-Added another patch in which I updated the comments of CpuMpData.

Regards
Yuanhao Xie

-----Original Message-----
From: Laszlo Ersek <ler...@redhat.com> 
Sent: Friday, November 17, 2023 4:38 PM
To: devel@edk2.groups.io; Ni, Ray <ray...@intel.com>; Xie, Yuanhao 
<yuanhao....@intel.com>
Cc: Dong, Eric <eric.d...@intel.com>; Kumar, Rahul R <rahul.r.ku...@intel.com>; 
Gerd Hoffmann <kra...@redhat.com>
Subject: Re: [edk2-devel] [Patch V4] UefiCpuPkg/MpInitLib: Enable execute 
disable bit.

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 (#111456): https://edk2.groups.io/g/devel/message/111456
Mute This Topic: https://groups.io/mt/102556608/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to