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 C5178740045 for ; Tue, 7 Nov 2023 10:59:45 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=w0HkxEdQiuGRZeVQXpbsxgw50sQFMn1p3LlBDYnWeK4=; 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=1699354784; v=1; b=Mf/EZwQI6KqgL9emWjNV3EnC7iu3yOYcOuOHOm6hEFlsw0jaNPJ3RhlU5EJDVgt8Pnu7RKUI TxrI/Wr1WK1C6sNn+UxyVs7hyKRvjoC8WgCV7+FuEL+6fWE+6fEgpaOM/WoVOldHZlDUc66AwJd HUQwzAh7lBgPw0P4PfQniX0U= X-Received: by 127.0.0.2 with SMTP id zAHHYY7687511xT5fUg3di3I; Tue, 07 Nov 2023 02:59:44 -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.web11.7646.1699354778850589528 for ; Tue, 07 Nov 2023 02:59:39 -0800 X-Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-564-YwYy9o0zNLuRTdfs8NwUfA-1; Tue, 07 Nov 2023 05:59:35 -0500 X-MC-Unique: YwYy9o0zNLuRTdfs8NwUfA-1 X-Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (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 46BA9835035; Tue, 7 Nov 2023 10:59:35 +0000 (UTC) X-Received: from [10.39.193.64] (unknown [10.39.193.64]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 91ED52166B26; Tue, 7 Nov 2023 10:59:33 +0000 (UTC) Message-ID: <656463e5-7c98-0624-b0d1-98c65880b44a@redhat.com> Date: Tue, 7 Nov 2023 11:59:32 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH v1 5/7] OvmfPkg: Specifies SmmCpuSyncLib instance To: devel@edk2.groups.io, jiaxin.wu@intel.com Cc: Ard Biesheuvel , Jiewen Yao , Jordan Justen , Eric Dong , Ray Ni , Zeng Star , Rahul Kumar , Gerd Hoffmann References: <20231103153012.3704-1-jiaxin.wu@intel.com> <20231103153012.3704-6-jiaxin.wu@intel.com> From: "Laszlo Ersek" In-Reply-To: <20231103153012.3704-6-jiaxin.wu@intel.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 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: 1yq7DdcgtAyhLiXbifAPnztpx7686176AA= 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="Mf/EZwQI"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io On 11/3/23 16:30, Wu, Jiaxin wrote: > The SmmCpuSyncLib instance is included in UefiCpuLibs.dsc.inc. > This patch is to specify SmmCpuSyncLib instance in OvmfPkg by > using "!include UefiCpuPkg/UefiCpuLibs.dsc.inc". >=20 > Change-Id: I2ab1737425e26a7bfc4f564b3b7f15ca5c2268fb > Cc: Ard Biesheuvel > Cc: Jiewen Yao > Cc: Jordan Justen > Cc: Eric Dong > Cc: Ray Ni > Cc: Zeng Star > Cc: Rahul Kumar > Cc: Gerd Hoffmann > Signed-off-by: Jiaxin Wu > --- > OvmfPkg/CloudHv/CloudHvX64.dsc | 1 + > OvmfPkg/OvmfPkgIa32.dsc | 1 + > OvmfPkg/OvmfPkgIa32X64.dsc | 1 + > OvmfPkg/OvmfPkgX64.dsc | 1 + > 4 files changed, 4 insertions(+) >=20 > diff --git a/OvmfPkg/CloudHv/CloudHvX64.dsc b/OvmfPkg/CloudHv/CloudHvX64.= dsc > index c23c7eaf6c..e65767fe16 100644 > --- a/OvmfPkg/CloudHv/CloudHvX64.dsc > +++ b/OvmfPkg/CloudHv/CloudHvX64.dsc > @@ -122,10 +122,11 @@ > # Library Class section - list of all Library Classes needed by this Pla= tform. > # > ########################################################################= ######## > =20 > !include MdePkg/MdeLibs.dsc.inc > +!include UefiCpuPkg/UefiCpuLibs.dsc.inc > =20 > [LibraryClasses] > PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf > TimerLib|OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.inf > ResetSystemLib|OvmfPkg/Library/ResetSystemLib/BaseResetSystemLib.inf > diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc > index ed3a19feeb..07d16e6935 100644 > --- a/OvmfPkg/OvmfPkgIa32.dsc > +++ b/OvmfPkg/OvmfPkgIa32.dsc > @@ -125,10 +125,11 @@ > # Library Class section - list of all Library Classes needed by this Pla= tform. > # > ########################################################################= ######## > =20 > !include MdePkg/MdeLibs.dsc.inc > +!include UefiCpuPkg/UefiCpuLibs.dsc.inc > =20 > [LibraryClasses] > PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf > TimerLib|OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.inf > ResetSystemLib|OvmfPkg/Library/ResetSystemLib/BaseResetSystemLib.inf > diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc > index 16ca139b29..8d243b7075 100644 > --- a/OvmfPkg/OvmfPkgIa32X64.dsc > +++ b/OvmfPkg/OvmfPkgIa32X64.dsc > @@ -130,10 +130,11 @@ > # Library Class section - list of all Library Classes needed by this Pla= tform. > # > ########################################################################= ######## > =20 > !include MdePkg/MdeLibs.dsc.inc > +!include UefiCpuPkg/UefiCpuLibs.dsc.inc > =20 > [LibraryClasses] > PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf > TimerLib|OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.inf > ResetSystemLib|OvmfPkg/Library/ResetSystemLib/BaseResetSystemLib.inf > diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc > index dc1a0942aa..6343789152 100644 > --- a/OvmfPkg/OvmfPkgX64.dsc > +++ b/OvmfPkg/OvmfPkgX64.dsc > @@ -143,10 +143,11 @@ > # Library Class section - list of all Library Classes needed by this Pla= tform. > # > ########################################################################= ######## > =20 > !include MdePkg/MdeLibs.dsc.inc > +!include UefiCpuPkg/UefiCpuLibs.dsc.inc > =20 > [LibraryClasses] > PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf > TimerLib|OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.inf > ResetSystemLib|OvmfPkg/Library/ResetSystemLib/BaseResetSystemLib.inf I am undecided about this patch. More precisely, I'm undecided that this is the right way to introduce "UefiCpuLibs.dsc.inc". In my opinion,"UefiCpuLibs.dsc.inc" should be a general-purpose include file. But, at this moment, the include file only resolves the "SmmCpuSyncLib" class -- and that resolution is useless for any IA32/X64 platform that does not use the SMM machinery. In particular, the resolution is useless even for OVMF X64 (for example) if it is built without SMM_REQUIRE. Furthermore, OVMF X64 uses a bunch of other UefiCpuPkg libraries: BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf CcExitLibNull/CcExitLibNull.inf CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf CpuPageTableLib/CpuPageTableLib.inf MicrocodeLib/MicrocodeLib.inf MmSaveStateLib/AmdMmSaveStateLib.inf MpInitLib/DxeMpInitLib.inf MpInitLib/PeiMpInitLib.inf MpInitLibUp/MpInitLibUp.inf MtrrLib/MtrrLib.inf SmmCpuRendezvousLib/SmmCpuRendezvousLib.inf It's weird to put SmmCpuSyncLib in the new DSC include file, but not CpuPageTableLib or MtrrLib (for example), which seem much more generic. For now I'd suggest avoiding "UefiCpuLibs.dsc.inc" altogether, and resolving just "SmmCpuSyncLib" in the OVMF DSC files -- and only when SMM_REQUIRE is defined on the build command line (i.e., when PiSmmCpuDxeSmm is built into the firmware platform). We can certainly introduce "UefiCpuLibs.dsc.inc" later, but for that: - we need to collect all UefiCpuPkg library classes and instances that are commonly used (and then probably use multiple module type sections!). Example: "OvmfPkg/Include/Dsc/OvmfTpmLibs.dsc.inc" - some of those resolutions should be conditional, and so we'd have to properly prefix macro names like SMM_REQUIRE with something like UEFI_CPU_. Basically introduce a namespace for those build time macros. Example: "NetworkPkg/NetworkDefines.dsc.inc", which uses the NETWORK_ macro prefix for enabling various features. 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 (#110840): https://edk2.groups.io/g/devel/message/110840 Mute This Topic: https://groups.io/mt/102366302/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-