From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web11.25850.1680184295103322870 for ; Thu, 30 Mar 2023 06:51:35 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uyewFWwP; spf=pass (domain: kernel.org, ip: 139.178.84.217, mailfrom: ardb@kernel.org) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 96B576206D; Thu, 30 Mar 2023 13:51:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F1FCC433EF; Thu, 30 Mar 2023 13:51:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680184294; bh=NQfuf8CSJUzGLYC5DhSOJfE0JeGeLAqlZLbnDc0kCWk=; h=From:To:Cc:Subject:Date:From; b=uyewFWwPGdL7xldXEC+qn68r57CFWY5gpEPL4yLUt24cK4taSetCPSAPbDkmxhLKy 8YP/PXLME8/2HhpfCPFRCkpKiyB6DKZOEMaUj3APs7bIFMvujf4+zkgCjtMrHOLfw0 TuhDuTTgNOseb127Kdxeo+dr5oPqLMO6trt7sj+WLCXkr/G0hVC0yOFlP8BscUfbNz 5byUuyD7QWP27EUslwDjYyotQH8THSEGruCiUNLskUMhJAS3LjEYctA3RcBUjzOhvg SoPimBz6fBQNVw87HMdrA2vM6l9S8ZjsgRqFusmDwdpp80ihGB7CP20oVcWYiDiX2+ jFwgNVmytQxvQ== From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Ni, Ray , Andrew Fish , "Kinney, Michael D" , "Liu, Zhiguang" , Rebecca Cran , Tom Lendacky Subject: [PATCH 0/4] UefiCpuPkg, OvmfPkf: Simplify CpuExceptionHandlerLib Date: Thu, 30 Mar 2023 15:51:18 +0200 Message-Id: <20230330135122.1445353-1-ardb@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable We have a special version of CpuExceptionHandlerLib for XCODE5, whose=0D linker (LLD) does not permit absolute symbol references in read-only=0D sections.=0D =0D Instead of fixing this up at runtime (which is done by writing the fixed=0D up values to the .text section), move the code templates into .data=0D instead. This way, they can be fixed up by the PE/COFF loader as usual.=0D =0D Given that this is a net improvement (as we no longer write to the=0D .text section at runtime), apply the fix for all versions of this=0D library, and drop the special XCODE5 version entirely.=0D =0D =0D Cc: Ni, Ray =0D Cc: Andrew Fish =0D Cc: "Kinney, Michael D" =0D Cc: "Liu, Zhiguang" =0D Cc: Rebecca Cran =0D Cc: Tom Lendacky =0D =0D Ard Biesheuvel (4):=0D UefiCpuPkg/CpuExceptionHandlerLib: Create LLD compatible SEC/PEI=0D version=0D UefiCpuPkg/CpuExceptionHandlerLib: Remove pointless runtime fixups=0D OvmfPkg: Drop special Xcode5 version of exception handler library=0D UefiCpuPkg/CpuExceptionHandlerLib: Drop special XCODE5 version=0D =0D OvmfPkg/AmdSev/AmdSevX64.dsc = | 4 -=0D OvmfPkg/CloudHv/CloudHvX64.dsc = | 4 -=0D OvmfPkg/IntelTdx/IntelTdxX64.dsc = | 4 -=0D OvmfPkg/Microvm/MicrovmX64.dsc = | 4 -=0D OvmfPkg/OvmfPkgIa32.dsc = | 4 -=0D OvmfPkg/OvmfPkgIa32X64.dsc = | 4 -=0D OvmfPkg/OvmfPkgX64.dsc = | 4 -=0D OvmfPkg/OvmfXen.dsc = | 4 -=0D UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf = | 2 +-=0D UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf = | 2 +-=0D UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf= | 2 +-=0D UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf = | 2 +-=0D UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.nasm = | 96 +++++++++++++++---=0D UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/{Xcode5ExceptionHandlerAsm.n= asm =3D> SecPeiExceptionHandlerAsm.nasm} | 107 +++-----------------=0D UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHandlerL= ib.inf | 65 ------------=0D UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHandlerL= ib.uni | 18 ----=0D 16 files changed, 100 insertions(+), 226 deletions(-)=0D rename UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/{Xcode5ExceptionHandl= erAsm.nasm =3D> SecPeiExceptionHandlerAsm.nasm} (70%)=0D delete mode 100644 UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiC= puExceptionHandlerLib.inf=0D delete mode 100644 UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiC= puExceptionHandlerLib.uni=0D =0D -- =0D 2.39.2=0D =0D