Skip to content

Commit 892c608

Browse files
ardbiesheuvelRussell King (Oracle)
authored andcommitted
ARM: 9199/1: spectre-bhb: use local DSB and elide ISB in loop8 sequence
The loop8 mitigation for Spectre-BHB only requires a CPU local DSB rather than a systemwide one, which is much more costly. And by the same reasoning as why it is justified to omit the ISB after BPIALL, we can also elide the ISB and rely on the exception return for the context synchronization. Signed-off-by: Ard Biesheuvel <[email protected]> Signed-off-by: Russell King (Oracle) <[email protected]>
1 parent c4f486f commit 892c608

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

arch/arm/kernel/entry-armv.S

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,8 +1131,9 @@ vector_bhb_loop8_\name:
11311131
3: W(b) . + 4
11321132
subs r0, r0, #1
11331133
bne 3b
1134-
dsb
1135-
isb
1134+
dsb nsh
1135+
@ isb not needed due to "movs pc, lr" in the vector stub
1136+
@ which gives a "context synchronisation".
11361137
b 2b
11371138
ENDPROC(vector_bhb_loop8_\name)
11381139
.previous

arch/arm/kernel/entry-common.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ ENTRY(vector_bhb_loop8_swi)
164164
1: b 2f
165165
2: subs r8, r8, #1
166166
bne 1b
167-
dsb
167+
dsb nsh
168168
isb
169169
b 3f
170170
ENDPROC(vector_bhb_loop8_swi)

0 commit comments

Comments
 (0)