Re: [PATCH 6/6] s390: introduce execute-trampolines for branches

From: David Woodhouse
Date: Wed Feb 07 2018 - 07:20:14 EST




On Wed, 2018-02-07 at 13:17 +0100, Martin Schwidefsky wrote:
> On Wed, 07 Feb 2018 12:07:55 +0000
> David Woodhouse <dwmw2@xxxxxxxxxxxxx> wrote:
>
> >
> > On Wed, 2018-02-07 at 11:07 +0100, Pavel Machek wrote:
> > >
> > > This is really unfortunate naming of kernel option.
> > >
> > > spectre_v2=off sounds like we are turning the "bug" off, but i somehow
> > > suspect you are turning the bug _workaround_ off.ÂÂ
> > That's consistent with what we have on x86.
> >
> > >
> > > >
> > > > +ifdef CONFIG_EXPOLINE
> > > > +ÂÂifeq ($(call cc-option-yn,$(CC_FLAGS_MARCH) -mindirect-branch=thunk),y)
> > > > +ÂÂÂÂCC_FLAGS_EXPOLINE := -mindirect-branch=thunk
> > > > +ÂÂÂÂCC_FLAGS_EXPOLINE += -mfunction-return=thunk
> > > > +ÂÂÂÂCC_FLAGS_EXPOLINE += -mindirect-branch-table
> > > > +ÂÂÂÂexport CC_FLAGS_EXPOLINE
> > > > +ÂÂÂÂcflags-y += $(CC_FLAGS_EXPOLINE)
> > > > +ÂÂelse
> > > > +ÂÂÂÂ$(warning "Your gcc lacks the -mindirect-branch= option")
> > > > +ÂÂendif
> > > > +endifÂÂ
> > That isn't, though. Linus asked us to drop the $(warning) part.
> >
> > ... and then spent a week building with a non-retpoline compiler and
> > not noticing, so he might have changed his mind ;)
>
> I found the warning to have some value, it helps for the case where my
> fingers are faster than my brain and I type "make" instead of "smake"
> which uses the alternative compiler with the required support.
>
> @Linus: do you want a warning or prefer not to have one ?

FWIW I agreed to drop it when the plan in my head was "we'll just turn
on IBRS instead if the compiler doesn't do full retpoline support".

Now that Linus has expressed a disinclination to take IBRS support in
that form, I might be more inclined to defend the $(warning) too.

Attachment: smime.p7s
Description: S/MIME cryptographic signature