From nobody Sat Feb 7 09:36:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+99497+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+99497+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1675361038; cv=none; d=zohomail.com; s=zohoarc; b=G+lP9F+tbkJNCHFzkla44kK+tIMbOTxVoLShaGNOSJdoktJijXQ0FARpg+5jybaMYsyczmGl24PxGLCKI674AVnl2x6I+7g+XXP+KSwHsUHIly1kvBs839+giiPj6Mu4QcuD7Xqzy1f4patWzV3CnWgDtPg0hfTnf/Gsvrh1UsA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675361038; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=+mVTxut1pKVXxkbV4mg9JPK6/NKaVGYQe9h+P/VxKsY=; b=eQKKxzibiLykADw9rkFKu/fcb3XY3DfgR2SuRxZGS57qpnbIi6RSfDS7AaSvghyWI/0/IS2XFjSlk8zX4n6j9Co3gh4tJR+VovXXFkU4vlVbgrcEvtxUiOUyaDYGu8g4uqf8/Clu040mbCqsyDyaoZqW6f/NVwNjQ1ZFfCU79Ok= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+99497+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1675361038854576.3299030501792; Thu, 2 Feb 2023 10:03:58 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id rQINYY1788612xY0XWmK874j; Thu, 02 Feb 2023 10:03:58 -0800 X-Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web11.1552.1675361035939996971 for ; Thu, 02 Feb 2023 10:03:56 -0800 X-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 7D1F361C43; Thu, 2 Feb 2023 18:03:55 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id B022DC4339C; Thu, 2 Feb 2023 18:03:52 +0000 (UTC) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Michael Kinney , Liming Gao , Jiewen Yao , Michael Kubacki , Sean Brogan , Rebecca Cran , Leif Lindholm , Sami Mujawar , Taylor Beebe Subject: [edk2-devel] [RFC PATCH 3/3] ArmVirtPkg/ArmVirtQemu: Implement BTI for runtime regions Date: Thu, 2 Feb 2023 19:03:35 +0100 Message-Id: <20230202180335.2256160-4-ardb@kernel.org> In-Reply-To: <20230202180335.2256160-1-ardb@kernel.org> References: <20230202180335.2256160-1-ardb@kernel.org> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ardb@kernel.org X-Gm-Message-State: ItQ9O9cwYXu7SZzQIGPYh0Prx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1675361038; bh=y7AzCZ3aq4vlM3ZJK0ao5k6Koeqh+APeRML2slNlEf8=; h=Cc:Date:From:Reply-To:Subject:To; b=SgdrCqLjIh1DUFnbQWxKYjx95696pKfYeh71GA/Y3pgNhqffWcq3gMNk+sYWVhZKNOb WJn0A5q2m7MzzXmjm2QVm2RUMPqqz4ClUkiInImVsXUdC5odE36cyDwTHCtB+fcwalApr nA0Ss6HtB9a2ZKbCm4LetxqC3dHufV0So/0= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1675361040965100003 Content-Type: text/plain; charset="utf-8" Add a build option RUNTIM_BTI_ENABLE, and wire it up to the newly added PCD that controls the value of the BTI flag in the memory attributes table, as well as the command line options passed to the compiler to get it to emit BTI landing pads in BASE and DXE_RUNTIME_DRIVER modules. Signed-off-by: Ard Biesheuvel --- ArmVirtPkg/ArmVirtQemu.dsc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc index 0f1c6395488a..0a67fe250d86 100644 --- a/ArmVirtPkg/ArmVirtQemu.dsc +++ b/ArmVirtPkg/ArmVirtQemu.dsc @@ -32,6 +32,7 @@ [Defines] DEFINE TPM2_ENABLE =3D FALSE DEFINE TPM2_CONFIG_ENABLE =3D FALSE DEFINE CAVIUM_ERRATUM_27456 =3D FALSE + DEFINE RUNTIME_BTI_ENABLE =3D TRUE =20 # # Network definition @@ -124,6 +125,11 @@ [BuildOptions] GCC:*_*_AARCH64_CC_XIPFLAGS =3D=3D !endif =20 +!if $(RUNTIME_BTI_ENABLE) =3D=3D TRUE +[BuildOptions.common.BASE,BuildOptions.common.DXE_RUNTIME_DRIVER] + GCC:*_*_AARCH64_CC_FLAGS =3D -mbranch-protection=3Dbti +!endif + !include NetworkPkg/NetworkBuildOptions.dsc.inc =20 ##########################################################################= ###### @@ -148,6 +154,8 @@ [PcdsFeatureFlag.common] [PcdsFixedAtBuild.common] !if $(ARCH) =3D=3D AARCH64 gArmTokenSpaceGuid.PcdVFPEnabled|1 + + gEfiMdeModulePkgTokenSpaceGuid.PcdMemoryAttributesTableForwardCfi|$(RUNT= IME_BTI_ENABLE) !endif =20 gArmPlatformTokenSpaceGuid.PcdCPUCoresStackBase|0x4007c000 --=20 2.39.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#99497): https://edk2.groups.io/g/devel/message/99497 Mute This Topic: https://groups.io/mt/96705498/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-