ARM: fix Thumb2 regression with Spectre BHB
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Fri, 11 Mar 2022 17:13:17 +0000 (17:13 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Mar 2022 13:23:44 +0000 (14:23 +0100)
commit 6c7cb60bff7aec24b834343ff433125f469886a3 upstream.

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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/kernel/entry-armv.S

index a0654ab1074f9c72b6f7ee6f0554adb61cd943d9..46b697dfa4cfc3075a3686dbadb0ac340fc974e2 100644 (file)
@@ -1038,9 +1038,9 @@ vector_bhb_loop8_\name:
 
        @ bhb workaround
        mov     r0, #8
-1:     b       . + 4
+3:     b       . + 4
        subs    r0, r0, #1
-       bne     1b
+       bne     3b
        dsb
        isb
        b       2b