The Arm Branch Target Identification (BTI) extension guards against
branching to an unintended instruction.
To support BTI add the landing pad instructions to the SHA2 functions.
These are from the hint space so are a nop on hardware that lacks BTI
support or if BTI isn't enabled.
Reviewed-by: Allan Jude <allan@klarasystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Signed-off-by: Andrew Turner <andrew.turner4@arm.com>
Closes #14862
Closes #15339
.type zfs_sha256_block_armv7,%function
.align 6
zfs_sha256_block_armv7:
+ hint #34 // bti c
stp x29,x30,[sp,#-128]!
add x29,sp,#0
.type zfs_sha256_block_armv8,%function
.align 6
zfs_sha256_block_armv8:
+ hint #34 // bti c
.Lv8_entry:
stp x29,x30,[sp,#-16]!
add x29,sp,#0
.type zfs_sha256_block_neon,%function
.align 4
zfs_sha256_block_neon:
+ hint #34 // bti c
.Lneon_entry:
stp x29, x30, [sp, #-16]!
mov x29, sp
.type zfs_sha512_block_armv7,%function
.align 6
zfs_sha512_block_armv7:
+ hint #34 // bti c
stp x29,x30,[sp,#-128]!
add x29,sp,#0
.type zfs_sha512_block_armv8,%function
.align 6
zfs_sha512_block_armv8:
+ hint #34 // bti c
.Lv8_entry:
// Armv8.3-A PAuth: even though x30 is pushed to stack it is not popped later
stp x29,x30,[sp,#-16]!