From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by mx.groups.io with SMTP id smtpd.web11.136530.1680714708575895824 for ; Wed, 05 Apr 2023 10:11:48 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@bsdio.com header.s=fm3 header.b=bcUUN7Vh; spf=pass (domain: bsdio.com, ip: 66.111.4.29, mailfrom: rebecca@bsdio.com) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id D821C5C00BC; Wed, 5 Apr 2023 13:11:47 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Wed, 05 Apr 2023 13:11:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdio.com; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1680714707; x=1680801107; bh=4MpHyDgJb+lZz2LvBmlvG4Y8+jt4uAWVZvj P3BMKq8s=; b=bcUUN7VhuH4wwOr90kP0zd4DMOXorDfEf83rQcPSlPtBkrSSTsG PA46IbNxVpQbkiI7h+intp4YbBbW8R800QiwRQwUKJusj9Q1STF0hjtZQnSsKjgX iSXUFSj1SSTmXcYi+bPKLuUtJikFSPWe+4yQvJb+GbV9OedZ1vKeo6LWq9ycgOLB f1ikWTWIEertsjM52nzh4QnriYoJnru/+tdH0IZg2Xvnp//7Qqv0JzDrbXdDCoVd cdY8zs1nQCQc7sx/cfrPYkEoaJ+T07h3bKXsK3yQd6UNbFXQkp+qWaiMf1bBU32f V7YovMQ+OJpm5JnMV9wu3g5+MoByOL1eG7A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1680714707; x=1680801107; bh=4MpHyDgJb+lZz2LvBmlvG4Y8+jt4uAWVZvj P3BMKq8s=; b=g2Mm9zSg9wWTXxPwy/4qKL6wpGnCqPC81mrRXBJAQUS/gPDFjZ/ YbWQ7ekiVL8l6pPev9RyK3FIvIlS0TfbtagfpeGRY1OWxUpqXgDzrYhxjhKkHo/B MgXsYA01fXzZx+l7RF5sAXl6G9eSMb0Kxqcr42s6yZ4OaU7UB9tDJRLhcluJbkM3 sHPOmLL9iFKYTEStXu5zQZffTJaa86fmr7imNoxUR5b/0lgrR/R8ldgZGRIemsFf IDgw8Us3sHtFaAcdffdEMor4YibwYCTL0zmzQF+DxPe7pkbiFVaR5/F5/9q/r7K+ n/RneJDxK+bt+ZqHseBf27RgvGfITSF2opA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdejuddgudduudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthekredttdefjeenucfhrhhomheptfgv sggvtggtrgcuvehrrghnuceorhgvsggvtggtrgessghsughiohdrtghomheqnecuggftrf grthhtvghrnhepteegjefgfeffleeftdelheefuefhuedtffeuudfhjeetuddvkeevkeet fedvleeknecuffhomhgrihhnpehgrhhouhhpshdrihhonecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomheprhgvsggvtggtrgessghsughiohdrtgho mh X-ME-Proxy: Feedback-ID: i5b994698:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 5 Apr 2023 13:11:46 -0400 (EDT) Message-ID: <5865860e-43da-2b24-87df-33d99b75126e@bsdio.com> Date: Wed, 5 Apr 2023 11:11:46 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [edk2-devel] [PATCH v4 0/6] UefiCpuPkg, OvmfPkg: Simplify CpuExceptionHandlerLib To: Ard Biesheuvel , devel@edk2.groups.io, mhaeuser@posteo.de, "Ni, Ray" Cc: Andrew Fish , "Kinney, Michael D" , "Liu, Zhiguang" , Tom Lendacky , "Liming Gao (Byosoft address)" References: <20230403142920.1921619-1-ardb@kernel.org> <9C006672-4DCD-4296-9C6F-F6B80E817666@posteo.de> From: "Rebecca Cran" In-Reply-To: Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sorry for the delay. I've just sent my reviewed-by. On 4/4/23 3:46 AM, Ard Biesheuvel wrote: > Thanks all > > Ray, any comments on this version? Thanks. > > Liming, Rebecca, any comments on the BaseTools changes? > > > > On Tue, 4 Apr 2023 at 09:57, Marvin Häuser wrote: >> FWIW, Reviewed-by: Marvin Häuser >> >>> On 3. Apr 2023, at 16:29, Ard Biesheuvel wrote: >>> >>> We have a special version of CpuExceptionHandlerLib for XCODE5, whose >>> linker (LLD) does not permit absolute symbol references in read-only >>> sections. >>> >>> 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. >>> >>> Changes since v3: >>> - Add another patch to move PeiCpuExceptionHandlerLib to SEC/PEI version >>> of the NASM source file >>> - Improve commit logs >>> >>> 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 >>> >>> Changes since v1: >>> - pass linker switches to permit absolute relocations in read-only >>> regions, and keep all code in .text >>> >>> Cc: "Ni, Ray" >>> Cc: Andrew Fish >>> Cc: "Kinney, Michael D" >>> Cc: "Liu, Zhiguang" >>> Cc: Rebecca Cran >>> Cc: Tom Lendacky >>> Cc: Marvin Häuser >>> >>> 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 >>> >>> 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.nasm => SecPeiExceptionHandlerAsm.nasm} | 108 +++--------------- >>> UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHandlerLib.inf | 65 ----------- >>> UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHandlerLib.uni | 18 --- >>> UefiCpuPkg/UefiCpuPkg.dsc | 7 -- >>> 18 files changed, 133 insertions(+), 232 deletions(-) >>> rename UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/{Xcode5ExceptionHandlerAsm.nasm => SecPeiExceptionHandlerAsm.nasm} (70%) >>> delete mode 100644 UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHandlerLib.inf >>> delete mode 100644 UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHandlerLib.uni >>> >>> -- >>> 2.39.2 >>> >> >> >> >> >>