From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 60A69D80A5F for ; Fri, 17 Nov 2023 08:38:19 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=N7paTwbgLb2Niz/IQz0kz+XjXO5fRuFZma1Cj4A1XdM=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1700210298; v=1; b=Pl3J7PEYnznu+35KOVcKva/Mul5D9p/S1BWZPodkOnqWrbz8U1oNvyDoeEUylfcPlyJF+Lqx MtIyJGzfpEeKA/AcSZXfDuHlhTE2g1Lfigajvyhcw/w/O2eK/57VyxtA+MpdyyaZQLd58yrsjrA bXaOF/YtgigudW82/d92I8cw= X-Received: by 127.0.0.2 with SMTP id UOqNYY7687511xLiaEiX8vP2; Fri, 17 Nov 2023 00:38:18 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web10.7597.1700210297346253010 for ; Fri, 17 Nov 2023 00:38:17 -0800 X-Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-454-o0kGnxcyPdWK7aXgPj1s3Q-1; Fri, 17 Nov 2023 03:38:13 -0500 X-MC-Unique: o0kGnxcyPdWK7aXgPj1s3Q-1 X-Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C820128EC116; Fri, 17 Nov 2023 08:38:12 +0000 (UTC) X-Received: from [10.39.193.21] (unknown [10.39.193.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C189C1121306; Fri, 17 Nov 2023 08:38:11 +0000 (UTC) Message-ID: <36666f4d-7066-972c-39c5-fe401f4783e0@redhat.com> Date: Fri, 17 Nov 2023 09:38:10 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [Patch V4] UefiCpuPkg/MpInitLib: Enable execute disable bit. To: devel@edk2.groups.io, ray.ni@intel.com, "Xie, Yuanhao" Cc: "Dong, Eric" , "Kumar, Rahul R" , Gerd Hoffmann References: <20231113055948.1773-1-yuanhao.xie@intel.com> <79bd9a7b-8b84-798c-c7ce-b7292dab1c7d@redhat.com> From: "Laszlo Ersek" In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,lersek@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: crCBPaH85f3kPTvl03rXPFLOx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=Pl3J7PEY; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.com (policy=none) 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. >=20 > 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. >=20 > If you compare all fields in ExchangeInfo and CpuMpData, following > fields are already duplicated: > * CpuMpData.CpuInfoHob <-> MpExchangeInfo.CpuInfo > * InitFlag > * SevEsIsEnabled > * SevSnpIsEnabled > * GhcbBase >=20 >=20 > 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 Thanks! Laszlo -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- 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/19134562= 12/xyzzy [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-