[edk2-devel] [PATCH v4 3/6] UefiCpuPkg/PeiCpuExceptionHandlerLib: Use SEC/PEI specific asm component

Ni, Ray ray.ni at intel.com
Thu Apr 6 06:00:24 UTC 2023


Reviewed-by: Ray Ni <ray.ni at intel.com>

> -----Original Message-----
> From: Ard Biesheuvel <ardb at kernel.org>
> Sent: Monday, April 3, 2023 10:29 PM
> To: devel at edk2.groups.io
> Cc: Ard Biesheuvel <ardb at kernel.org>; Ni, Ray <ray.ni at intel.com>; Andrew
> Fish <afish at apple.com>; Kinney, Michael D <michael.d.kinney at intel.com>;
> Liu, Zhiguang <zhiguang.liu at intel.com>; Rebecca Cran
> <rebecca at bsdio.com>; Tom Lendacky <thomas.lendacky at amd.com>;
> Marvin Häuser <mhaeuser at posteo.de>
> Subject: [PATCH v4 3/6] UefiCpuPkg/PeiCpuExceptionHandlerLib: Use
> SEC/PEI specific asm component
> 
> The PEI flavor of CpuExceptionHandlerLib never populates more than 32
> IDT vectors, and there is no CET shadow stack support in the PEI phase.
> So there is no need to use the generic ExceptionHandler NASM source,
> which carries a 256-entry template and CET support, and writes to its
> own .text section when built using XCODE, which is not permitted in the
> PEI phase. So let's switch to the reduced SEC/PEI version of this
> component, which is sufficient for PEI and doesn't suffer from the same
> issue.
> 
> Signed-off-by: Ard Biesheuvel <ardb at kernel.org>
> ---
> 
> UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf
> | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git
> a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.i
> nf
> b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.i
> nf
> index 5339f8e604045801..3bcaff5c5fe4633a 100644
> ---
> a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.i
> nf
> +++
> b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.i
> nf
> @@ -28,7 +28,7 @@ [Sources.Ia32]
>    Ia32/ArchInterruptDefs.h
> 
> 
> 
>  [Sources.X64]
> 
> -  X64/Xcode5ExceptionHandlerAsm.nasm
> 
> +  X64/SecPeiExceptionHandlerAsm.nasm
> 
>    X64/ArchExceptionHandler.c
> 
>    X64/ArchInterruptDefs.h
> 
> 
> 
> @@ -62,3 +62,5 @@ [Pcd]
>  [FeaturePcd]
> 
>    gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmStackGuard                    ##
> CONSUMES
> 
> 
> 
> +[BuildOptions]
> 
> +  XCODE:*_*_X64_NASM_FLAGS = -D NO_ABSOLUTE_RELOCS_IN_TEXT
> 
> --
> 2.39.2



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




More information about the edk2-devel-archive mailing list