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.web10.71858.1680532177820296616 for ; Mon, 03 Apr 2023 07:29:37 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=u2yRLcOj; 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 663BF61DE4; Mon, 3 Apr 2023 14:29:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F08B5C4339C; Mon, 3 Apr 2023 14:29:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680532176; bh=cnoV3aNi/BpbV17JB32U+MKZhOboor/p5HwgKaSWy4Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u2yRLcOjfWbFqEbMf4uC+SZaB5a89GXltqWwICZx/f1kX9zwZFHeKREC34gRyuyh+ MgHGfKSqDxggk1HEYxZgpogQmJm00FaHrxgHZFBdXRKT5Z0I1jv4Xiuxy+6TmUCqgQ fJYXvW1YmHo6I1AQ/SjFKbRXHp0gl4UdZGnqCQwDopbbCA/Njc9aqgW3OxD/wXVJdV dM3LQawjNvtYbf8WCTytaUknaZSoGOo852EpdhWhbwFTgxpBOzPlToNcpPD5yc0L0P a2S3uztqyYqcQw26bdRke+jNN3M8lXgjUc0GeevfwRrCYezg1hXtPE3rpdUGhSiATL e4eYwhysBrZSw== From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: Ard Biesheuvel , "Ni, Ray" , Andrew Fish , "Kinney, Michael D" , "Liu, Zhiguang" , Rebecca Cran , Tom Lendacky , =?UTF-8?q?Marvin=20H=C3=A4user?= Subject: [PATCH v4 3/6] UefiCpuPkg/PeiCpuExceptionHandlerLib: Use SEC/PEI specific asm component Date: Mon, 3 Apr 2023 16:29:17 +0200 Message-Id: <20230403142920.1921619-4-ardb@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230403142920.1921619-1-ardb@kernel.org> References: <20230403142920.1921619-1-ardb@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 --- UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf | = 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandl= erLib.inf b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandle= rLib.inf 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=0D =0D [Sources.X64]=0D - X64/Xcode5ExceptionHandlerAsm.nasm=0D + X64/SecPeiExceptionHandlerAsm.nasm=0D X64/ArchExceptionHandler.c=0D X64/ArchInterruptDefs.h=0D =0D @@ -62,3 +62,5 @@ [Pcd] [FeaturePcd]=0D gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmStackGuard ## CONS= UMES=0D =0D +[BuildOptions]=0D + XCODE:*_*_X64_NASM_FLAGS =3D -D NO_ABSOLUTE_RELOCS_IN_TEXT=0D --=20 2.39.2