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.31893.1679914913690319937
 for <devel@edk2.groups.io>;
 Mon, 27 Mar 2023 04:01:53 -0700
Authentication-Results: mx.groups.io;
 dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rMHeLum1;
 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 4106F611A9;
	Mon, 27 Mar 2023 11:01:53 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D18EC4339B;
	Mon, 27 Mar 2023 11:01:50 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1679914912;
	bh=tTXXrX3bHLCV02RVxt70UgxFp6rkEXbzsDp4VpWLTjA=;
	h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
	b=rMHeLum1cq5CpizPrKBEQyYUquL7W9YXldVIjEqsrsVWA+dqB62i8CyMZpdTm3nP9
	 YEn9wrt3sHnRQJXkpDM2FkD5rY11GlKxhv9YkefQ79bWllUAemcs2LT4VgLallMV6v
	 7Fefn/hQ863XhWOpSki0bxNo2sIUxX146NqL5QHP7p4oayqm/00nIB0yO1NWWZ6ULU
	 zM5I762GkXts4DeOeybwPRiek8n2hcy8ObM5x1qQWgDiSrF2+MQmzwJfKGEF2+bZJO
	 ha/ykQqYrkf/fzAjwxVEUgU14eOgccAM8qL0AblsZbzQ9neLHVcjNwUsw7AuToVDcN
	 QsE9bKUf0RXkw==
From: "Ard Biesheuvel" <ardb@kernel.org>
To: devel@edk2.groups.io
Cc: Ard Biesheuvel <ardb@kernel.org>,
	Michael Kinney <michael.d.kinney@intel.com>,
	Liming Gao <gaoliming@byosoft.com.cn>,
	Jiewen Yao <jiewen.yao@intel.com>,
	Michael Kubacki <michael.kubacki@microsoft.com>,
	Sean Brogan <sean.brogan@microsoft.com>,
	Rebecca Cran <quic_rcran@quicinc.com>,
	Leif Lindholm <quic_llindhol@quicinc.com>,
	Sami Mujawar <sami.mujawar@arm.com>,
	Taylor Beebe <t@taylorbeebe.com>,
	=?UTF-8?q?Marvin=20H=C3=A4user?= <mhaeuser@posteo.de>,
	Bob Feng <bob.c.feng@intel.com>
Subject: [PATCH v2 07/17] MdePkg/BaseSynchronizationLib AARCH64: Make asm files BTI compatible
Date: Mon, 27 Mar 2023 13:01:02 +0200
Message-Id: <20230327110112.262503-8-ardb@kernel.org>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20230327110112.262503-1-ardb@kernel.org>
References: <20230327110112.262503-1-ardb@kernel.org>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

Add the BTI instructions and the associated note to make the AArch64 asm
objects compatible with BTI enforcement.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
 MdePkg/Library/BaseSynchronizationLib/AArch64/Synchronization.S | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/MdePkg/Library/BaseSynchronizationLib/AArch64/Synchronization.=
S b/MdePkg/Library/BaseSynchronizationLib/AArch64/Synchronization.S
index 1a0eb971a6c92d4c..dfcfc80d0cbeff5e 100644
--- a/MdePkg/Library/BaseSynchronizationLib/AArch64/Synchronization.S
+++ b/MdePkg/Library/BaseSynchronizationLib/AArch64/Synchronization.S
@@ -41,6 +41,7 @@ GCC_ASM_EXPORT(InternalSyncDecrement)
 //  IN      UINT16                    ExchangeValue=0D
 //  )=0D
 ASM_PFX(InternalSyncCompareExchange16):=0D
+  AARCH64_BTI(c)=0D
   uxth    w1, w1=0D
   uxth    w2, w2=0D
   dmb     sy=0D
@@ -84,6 +85,7 @@ InternalSyncCompareExchange16Fail:
 //  IN      UINT32                    ExchangeValue=0D
 //  )=0D
 ASM_PFX(InternalSyncCompareExchange32):=0D
+  AARCH64_BTI(c)=0D
   dmb     sy=0D
 =0D
 InternalSyncCompareExchange32Again:=0D
@@ -124,6 +126,7 @@ InternalSyncCompareExchange32Fail:
 //  IN      UINT64                    ExchangeValue=0D
 //  )=0D
 ASM_PFX(InternalSyncCompareExchange64):=0D
+  AARCH64_BTI(c)=0D
   dmb     sy=0D
 =0D
 InternalSyncCompareExchange64Again:=0D
@@ -159,6 +162,7 @@ InternalSyncCompareExchange64Fail:
 //  IN      volatile UINT32           *Value=0D
 //  )=0D
 ASM_PFX(InternalSyncIncrement):=0D
+  AARCH64_BTI(c)=0D
   dmb     sy=0D
 TryInternalSyncIncrement:=0D
   ldxr    w1, [x0]=0D
@@ -188,6 +192,7 @@ TryInternalSyncIncrement:
 //  IN      volatile UINT32           *Value=0D
 //  )=0D
 ASM_PFX(InternalSyncDecrement):=0D
+  AARCH64_BTI(c)=0D
   dmb     sy=0D
 TryInternalSyncDecrement:=0D
   ldxr    w1, [x0]=0D
--=20
2.39.2