Cranelift AArch64: Harden the Spectre mitigations (#4555)

Use the `CSDB` instruction following Arm's recommendation.

Copyright (c) 2022, Arm Limited.
This commit is contained in:
Anton Kirilov
2022-08-01 18:20:48 +01:00
committed by GitHub
parent 893fadb485
commit a47a82d2e5
8 changed files with 42 additions and 20 deletions

View File

@@ -24,6 +24,7 @@ block0(v0: i64, v1: i32):
; subs xzr, x10, x11
; movz x14, #0
; csel x0, x14, x13, hi
; csdb
; ret
; block2:
; udf #0xc11f
@@ -46,7 +47,7 @@ block0(v0: i64, v1: i32):
; subs xzr, x8, #65536
; movz x11, #0
; csel x0, x11, x10, hi
; csdb
; ret
; block2:
; udf #0xc11f

View File

@@ -32,7 +32,7 @@ block5(v5: i32):
; block0:
; emit_island 36
; subs wzr, w0, #3
; b.hs label1 ; adr x15, pc+16 ; ldrsw x1, [x15, x0, LSL 2] ; add x15, x15, x1 ; br x15 ; jt_entries [Label(MachLabel(3)), Label(MachLabel(5)), Label(MachLabel(7))]
; b.hs label1 ; csel x1, xzr, x0, hs ; csdb ; adr x15, pc+16 ; ldrsw x1, [x15, x1, LSL 2] ; add x15, x15, x1 ; br x15 ; jt_entries [Label(MachLabel(3)), Label(MachLabel(5)), Label(MachLabel(7))]
; block1:
; movz x5, #4
; b label2