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

Signed-off-by: Ard Biesheuvel <a...@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
 //  )
 ASM_PFX(InternalSyncCompareExchange16):
+  AARCH64_BTI(c)
   uxth    w1, w1
   uxth    w2, w2
   dmb     sy
@@ -84,6 +85,7 @@ InternalSyncCompareExchange16Fail:
 //  IN      UINT32                    ExchangeValue
 //  )
 ASM_PFX(InternalSyncCompareExchange32):
+  AARCH64_BTI(c)
   dmb     sy
 
 InternalSyncCompareExchange32Again:
@@ -124,6 +126,7 @@ InternalSyncCompareExchange32Fail:
 //  IN      UINT64                    ExchangeValue
 //  )
 ASM_PFX(InternalSyncCompareExchange64):
+  AARCH64_BTI(c)
   dmb     sy
 
 InternalSyncCompareExchange64Again:
@@ -159,6 +162,7 @@ InternalSyncCompareExchange64Fail:
 //  IN      volatile UINT32           *Value
 //  )
 ASM_PFX(InternalSyncIncrement):
+  AARCH64_BTI(c)
   dmb     sy
 TryInternalSyncIncrement:
   ldxr    w1, [x0]
@@ -188,6 +192,7 @@ TryInternalSyncIncrement:
 //  IN      volatile UINT32           *Value
 //  )
 ASM_PFX(InternalSyncDecrement):
+  AARCH64_BTI(c)
   dmb     sy
 TryInternalSyncDecrement:
   ldxr    w1, [x0]
-- 
2.39.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101931): https://edk2.groups.io/g/devel/message/101931
Mute This Topic: https://groups.io/mt/97879288/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to