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

Russell King (Oracle) linux at armlinux.org.uk
Fri Mar 11 11:59:06 PST 2022


On Fri, Mar 11, 2022 at 11:39:35AM -0800, Linus Torvalds wrote:
> 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 don't like them, but in a macro, I don't think there's much choice.
I don't think choosing some other starting number works either, because
then one ends up always starting at some other number and it's just the
same problem, just with a different starting number.

I guess one way around this would be to use a random local label
number each time, but I suspect there isn't enough range to ensure
they are unique using that method.

I've already mentioned to Nathan that I really wish gas etc would
allow local labels which are not purely numerical (so we can make
them more descriptive.) However, I can see why it isn't permitted,
because of the 'b' and 'f' suffix.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!



More information about the linux-arm-kernel mailing list