summaryrefslogtreecommitdiffstats
path: root/MdePkg/Library/BaseSynchronizationLib
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2023-03-25 17:37:55 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-03-30 11:05:22 +0000
commit35318c2eb9ad3747f70cdee0714893e282ca51b0 (patch)
tree0dbcc2632d808ec02805b037cb5d8ee606125078 /MdePkg/Library/BaseSynchronizationLib
parent0ee255f50a7d612f157ab95db00dc49406b7a627 (diff)
downloadedk2-35318c2eb9ad3747f70cdee0714893e282ca51b0.tar.gz
edk2-35318c2eb9ad3747f70cdee0714893e282ca51b0.tar.bz2
edk2-35318c2eb9ad3747f70cdee0714893e282ca51b0.zip
MdePkg/BaseSynchronizationLib AARCH64: Make asm files BTI compatible
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> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com> Reviewed-by: Oliver Smith-Denny <osd@smith-denny.com>
Diffstat (limited to 'MdePkg/Library/BaseSynchronizationLib')
-rw-r--r--MdePkg/Library/BaseSynchronizationLib/AArch64/Synchronization.S5
1 files changed, 5 insertions, 0 deletions
diff --git a/MdePkg/Library/BaseSynchronizationLib/AArch64/Synchronization.S b/MdePkg/Library/BaseSynchronizationLib/AArch64/Synchronization.S
index 1a0eb971a6..dfcfc80d0c 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]