[edk2-devel] [PATCH 0/4] UefiCpuPkg, OvmfPkf: Simplify CpuExceptionHandlerLib

Ard Biesheuvel ardb at kernel.org
Thu Mar 30 13:51:18 UTC 2023


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 (which is done by writing the fixed
up values to the .text section), move the code templates into .data
instead. This way, they can be fixed up by the PE/COFF loader as usual.

Given that this is a net improvement (as we no longer write to the
.text section at runtime), apply the fix for all versions of this
library, and drop the special XCODE5 version entirely.


Cc: Ni, Ray <ray.ni at intel.com>
Cc: Andrew Fish <afish at apple.com>
Cc: "Kinney, Michael D" <michael.d.kinney at intel.com>
Cc: "Liu, Zhiguang" <zhiguang.liu at intel.com>
Cc: Rebecca Cran <rebecca at bsdio.com>
Cc: Tom Lendacky <thomas.lendacky at amd.com>

Ard Biesheuvel (4):
  UefiCpuPkg/CpuExceptionHandlerLib: Create LLD compatible SEC/PEI
    version
  UefiCpuPkg/CpuExceptionHandlerLib: Remove pointless runtime fixups
  OvmfPkg: Drop special Xcode5 version of exception handler library
  UefiCpuPkg/CpuExceptionHandlerLib: Drop special XCODE5 version

 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                                          |   2 +-
 UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf                                          |   2 +-
 UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf                                       |   2 +-
 UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf                                          |   2 +-
 UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.nasm                                           |  96 +++++++++++++++---
 UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/{Xcode5ExceptionHandlerAsm.nasm => SecPeiExceptionHandlerAsm.nasm} | 107 +++-----------------
 UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHandlerLib.inf                                 |  65 ------------
 UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHandlerLib.uni                                 |  18 ----
 16 files changed, 100 insertions(+), 226 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



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#102181): https://edk2.groups.io/g/devel/message/102181
Mute This Topic: https://groups.io/mt/97950942/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list