linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] ARM: fix Thumb2 regression with Spectre BHB
@ 2022-03-11 17:13 Russell King (Oracle)
  2022-03-11 19:39 ` Linus Torvalds
  0 siblings, 1 reply; 5+ messages in thread
From: Russell King (Oracle) @ 2022-03-11 17:13 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: stable, Catalin Marinas, linux-arm-kernel

When building for Thumb2, the vectors make use of a local label. Sadly,
the Spectre BHB code also uses a local label with the same number which
results in the Thumb2 reference pointing at the wrong place. Fix this
by changing the number used for the Spectre BHB local label.

Fixes: b9baf5c8c5c3 ("ARM: Spectre-BHB workaround")
Tested-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 arch/arm/kernel/entry-armv.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index faa0ca2ba576..63a9d59478fa 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -962,9 +962,9 @@ ENDPROC(vector_\name)
 
 	@ bhb workaround
 	mov	r0, #8
-1:	b	. + 4
+3:	b	. + 4
 	subs	r0, r0, #1
-	bne	1b
+	bne	3b
 	dsb
 	isb
 	b	2b
-- 
2.30.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-03-11 20:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-11 17:13 [PATCH v2] ARM: fix Thumb2 regression with Spectre BHB Russell King (Oracle)
2022-03-11 19:39 ` Linus Torvalds
2022-03-11 19:43   ` Linus Torvalds
2022-03-11 19:59   ` Russell King (Oracle)
2022-03-11 20:41     ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).