[edk2-devel] [PATCH v2 02/17] MdePkg/BaseCpuLib AARCH64: Make asm files BTI compatible

Ard Biesheuvel ardb at kernel.org
Mon Mar 27 11:00:57 UTC 2023


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

Signed-off-by: Ard Biesheuvel <ardb at 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/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list