From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.65]) by mx.groups.io with SMTP id smtpd.web10.95871.1680595051979165068 for ; Tue, 04 Apr 2023 00:57:32 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@posteo.de header.s=2017 header.b=lqJ1Xxm3; spf=pass (domain: posteo.de, ip: 185.67.36.65, mailfrom: mhaeuser@posteo.de) Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 1BF5424034F for ; Tue, 4 Apr 2023 09:57:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1680595050; bh=o8+RIcY0/DYoR03TnY3so8te/fq5eIO/qgcs6LiC0BI=; h=From:Subject:Date:Cc:To:From; b=lqJ1Xxm3zTOIuis55J6I/8e6mstlIhgn3hhIS0d9fY+OYnlc8Q+25GkGdPJLBXT97 IrQKVlyO8jdGrQgp67GqXN198DVNVC2By30f3TakwKA09ggXUDSrvWSKThylAP9WVV 0Ncz0nkfO+tbSfuCOpLQDSnQEIwujEdlXR3m90rUW889zI9sukn9IoRnwP9luKaSEc a0+JQfAYRl3hmV8kqEfs2aVxpnrRFgydLwY5CG9EFsOyOSnUISqrCCAlmxjRZf8jsQ vjzroFUPq8bLzHM4jP6LBswlbtGdidAJBEfgDo/3k91VKJo3yKFWxBKxtu4LxnkXgJ qTV7ShZ9+PDsA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PrKqX6CY9z6tsb; Tue, 4 Apr 2023 09:57:28 +0200 (CEST) From: =?UTF-8?B?TWFydmluIEjDpHVzZXI=?= Mime-Version: 1.0 (1.0) Subject: Re: [PATCH v4 0/6] UefiCpuPkg, OvmfPkg: Simplify CpuExceptionHandlerLib Date: Tue, 4 Apr 2023 07:57:28 +0000 Message-Id: <9C006672-4DCD-4296-9C6F-F6B80E817666@posteo.de> References: <20230403142920.1921619-1-ardb@kernel.org> Cc: devel@edk2.groups.io, "Ni, Ray" , Andrew Fish , "Kinney, Michael D" , "Liu, Zhiguang" , Rebecca Cran , Tom Lendacky In-Reply-To: <20230403142920.1921619-1-ardb@kernel.org> To: Ard Biesheuvel Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable FWIW, Reviewed-by: Marvin H=C3=A4user > On 3. Apr 2023, at 16:29, Ard Biesheuvel wrote: >=20 > =EF=BB=BFWe have a special version of CpuExceptionHandlerLib for XCODE5, w= hose > linker (LLD) does not permit absolute symbol references in read-only > sections. >=20 > Instead of fixing this up at runtime for all toolchains (which is done > by writing the fixed up values to the .text section, which we'd prefer > to avoid), tweak the SEC/PEI version so it does not need this, and > update the remaining versions to only incorporate this logic when using > the XCODE toolchain. >=20 > Changes since v3: > - Add another patch to move PeiCpuExceptionHandlerLib to SEC/PEI version > of the NASM source file > - Improve commit logs >=20 > Changes since v2: > - As Marvin points out, using '-read_only_relocs suppress' with the X64 > XCODE linker is a terrible idea, as it corrupts the resulting PE > binaries, so instead, let's do the following: > . tweak the SEC/PEI version of the library so the relocs are emitted > into .data when using XCODE; > . tweak the other versions so the runtime fixups are only done when > using XCODE > - add acks from Jiewen and Ray >=20 > Changes since v1: > - pass linker switches to permit absolute relocations in read-only > regions, and keep all code in .text >=20 > Cc: "Ni, Ray" > Cc: Andrew Fish > Cc: "Kinney, Michael D" > Cc: "Liu, Zhiguang" > Cc: Rebecca Cran > Cc: Tom Lendacky > Cc: Marvin H=C3=A4user >=20 > Ard Biesheuvel (6): > BaseTools/tools_def CLANGDWARF: Permit text relocations > UefiCpuPkg/CpuExceptionHandlerLib: Use single SEC/PEI version > UefiCpuPkg/PeiCpuExceptionHandlerLib: Use SEC/PEI specific asm > component > UefiCpuPkg/CpuExceptionHandlerLib: Make runtime fixups XCODE-only > OvmfPkg: Drop special Xcode5 version of exception handler library > UefiCpuPkg/CpuExceptionHandlerLib: Drop special XCODE5 version >=20 > BaseTools/Conf/tools_def.template = | 2 +- > OvmfPkg/AmdSev/AmdSevX64.dsc = | 4 - > OvmfPkg/CloudHv/CloudHvX64.dsc = | 4 - > OvmfPkg/IntelTdx/IntelTdxX64.dsc = | 4 - > OvmfPkg/Microvm/MicrovmX64.dsc = | 4 - > OvmfPkg/OvmfPkgIa32.dsc = | 4 - > OvmfPkg/OvmfPkgIa32X64.dsc = | 4 - > OvmfPkg/OvmfPkgX64.dsc = | 4 - > OvmfPkg/OvmfXen.dsc = | 4 - > UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf = | 5 +- > UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf = | 4 +- > UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf= | 4 +- > UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf = | 4 +- > UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.nasm = | 116 +++++++++++++++++--- > UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/{Xcode5ExceptionHandlerAsm.n= asm =3D> SecPeiExceptionHandlerAsm.nasm} | 108 +++--------------- > UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHandlerL= ib.inf | 65 ----------- > UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHandlerL= ib.uni | 18 --- > UefiCpuPkg/UefiCpuPkg.dsc = | 7 -- > 18 files changed, 133 insertions(+), 232 deletions(-) > rename UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/{Xcode5ExceptionHandl= erAsm.nasm =3D> SecPeiExceptionHandlerAsm.nasm} (70%) > delete mode 100644 UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiC= puExceptionHandlerLib.inf > delete mode 100644 UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiC= puExceptionHandlerLib.uni >=20 > --=20 > 2.39.2 >=20