[PATCH v2] ARM: fix Thumb2 regression with Spectre BHB

Linus Torvalds torvalds at linux-foundation.org
Fri Mar 11 11:39:35 PST 2022


On Fri, Mar 11, 2022 at 9:13 AM Russell King (Oracle)
<rmk+kernel at armlinux.org.uk> wrote:
>
> 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.

Ugh. Those local names are nasty.

And even with this patch - which I'm about to apply right now - I
think the numbering is horrendous. It seems entirely random with "2"
being used first in that vector_stub macro, and now 1 and 3 in the
middle.

I assume it's entirely historical, and the numbering reflects the
order the labels were added, rather than anything logical.

Yes, local labels are really convenient in assembler macros, but I can
also heartily suggest using numbers that stand out more and are more
unique. Certainly not 1/2/3 in an odd and illogical order.

             Linus



More information about the linux-arm-kernel mailing list