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/BaseRngLib/AArch64/ArmReadIdIsar0.S | 3 +--
 MdePkg/Library/BaseRngLib/AArch64/ArmRng.S         | 1 +
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/MdePkg/Library/BaseRngLib/AArch64/ArmReadIdIsar0.S 
b/MdePkg/Library/BaseRngLib/AArch64/ArmReadIdIsar0.S
index 82a00d36221278e0..d30b63fe5c68c565 100644
--- a/MdePkg/Library/BaseRngLib/AArch64/ArmReadIdIsar0.S
+++ b/MdePkg/Library/BaseRngLib/AArch64/ArmReadIdIsar0.S
@@ -25,7 +25,6 @@ GCC_ASM_EXPORT(ArmReadIdIsar0)
 #  );
 #
 ASM_PFX(ArmReadIdIsar0):
+  AARCH64_BTI(c)
   mrs  x0, id_aa64isar0_el1 // Read ID_AA64ISAR0 Register
   ret
-
-
diff --git a/MdePkg/Library/BaseRngLib/AArch64/ArmRng.S 
b/MdePkg/Library/BaseRngLib/AArch64/ArmRng.S
index 5159f467e3a6cd6e..27a847b996fd1d2a 100644
--- a/MdePkg/Library/BaseRngLib/AArch64/ArmRng.S
+++ b/MdePkg/Library/BaseRngLib/AArch64/ArmRng.S
@@ -31,6 +31,7 @@ GCC_ASM_EXPORT(ArmRndr)
 #  );
 #
 ASM_PFX(ArmRndr):
+  AARCH64_BTI(c)
   mrs  x1, RNDR
   str  x1, [x0]
   cset x0, ne    // RNDR sets NZCV to 0b0100 on failure
-- 
2.39.2



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


Reply via email to