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/BaseCpuLib/AArch64/CpuFlushTlb.S | 1 +
 MdePkg/Library/BaseCpuLib/AArch64/CpuSleep.S    | 1 +
 2 files changed, 2 insertions(+)

diff --git a/MdePkg/Library/BaseCpuLib/AArch64/CpuFlushTlb.S 
b/MdePkg/Library/BaseCpuLib/AArch64/CpuFlushTlb.S
index 82a7232268f59809..12c2421b6d327a7b 100644
--- a/MdePkg/Library/BaseCpuLib/AArch64/CpuFlushTlb.S
+++ b/MdePkg/Library/BaseCpuLib/AArch64/CpuFlushTlb.S
@@ -26,6 +26,7 @@ GCC_ASM_EXPORT(CpuFlushTlb)
 #  )#
 #
 ASM_PFX(CpuFlushTlb):
+  AARCH64_BTI(c)
   tlbi  vmalle1                 // Invalidate Inst TLB and Data TLB
   dsb   sy
   isb
diff --git a/MdePkg/Library/BaseCpuLib/AArch64/CpuSleep.S 
b/MdePkg/Library/BaseCpuLib/AArch64/CpuSleep.S
index 410a271565edfb68..6853e0c56e0bb135 100644
--- a/MdePkg/Library/BaseCpuLib/AArch64/CpuSleep.S
+++ b/MdePkg/Library/BaseCpuLib/AArch64/CpuSleep.S
@@ -29,5 +29,6 @@ GCC_ASM_EXPORT(CpuSleep)
 #
 
 ASM_PFX(CpuSleep):
+    AARCH64_BTI(c)
     wfi
     ret
-- 
2.39.2



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


Reply via email to