public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: devel@edk2.groups.io, ray.ni@intel.com, "Xie,
	Yuanhao" <yuanhao.xie@intel.com>
Cc: "Dong, Eric" <eric.dong@intel.com>,
	"Kumar, Rahul R" <rahul.r.kumar@intel.com>,
	Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [edk2-devel] [Patch V4] UefiCpuPkg/MpInitLib: Enable execute disable bit.
Date: Fri, 17 Nov 2023 09:38:10 +0100	[thread overview]
Message-ID: <36666f4d-7066-972c-39c5-fe401f4783e0@redhat.com> (raw)
In-Reply-To: <MN6PR11MB8244F1E59C7570A68D4020F48CB7A@MN6PR11MB8244.namprd11.prod.outlook.com>

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 <lersek@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/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  reply	other threads:[~2023-11-17  8:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-13  5:59 [edk2-devel] [Patch V4] UefiCpuPkg/MpInitLib: Enable execute disable bit Yuanhao Xie
2023-11-13 10:54 ` Gerd Hoffmann
2023-11-13 11:08   ` Yuanhao Xie
2023-11-13 12:28 ` Gerd Hoffmann
2023-11-13 18:02 ` Laszlo Ersek
2023-11-17  7:01   ` Ni, Ray
2023-11-17  8:38     ` Laszlo Ersek [this message]
2023-11-20  4:57       ` Yuanhao Xie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=36666f4d-7066-972c-39c5-fe401f4783e0@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox