From f8b1854b92559ad28dc6df6bb886652b87e2a422 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Sat, 25 Mar 2023 18:12:55 +0100 Subject: MdePkg/BaseRngLib 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 Reviewed-by: Leif Lindholm Reviewed-by: Oliver Smith-Denny --- MdePkg/Library/BaseRngLib/AArch64/ArmReadIdIsar0.S | 3 +-- MdePkg/Library/BaseRngLib/AArch64/ArmRng.S | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'MdePkg') diff --git a/MdePkg/Library/BaseRngLib/AArch64/ArmReadIdIsar0.S b/MdePkg/Library/BaseRngLib/AArch64/ArmReadIdIsar0.S index 82a00d3622..d30b63fe5c 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 5159f467e3..27a847b996 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 -- cgit