[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAATStaPkPUb-gSJTcYP0Xdnc+2i649iCquJE6Y4VpBcw7+L8Uw@mail.gmail.com>
Date: Thu, 5 Nov 2020 12:13:20 +1100
From: "Anand K. Mistry" <amistry@...gle.com>
To: Borislav Petkov <bp@...en8.de>
Cc: Tom Lendacky <thomas.lendacky@....com>, x86@...nel.org,
Joel Fernandes <joelaf@...gle.com>,
Anthony Steinhauser <asteinhauser@...gle.com>,
tglx@...utronix.de, "H. Peter Anvin" <hpa@...or.com>,
Ingo Molnar <mingo@...hat.com>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Mark Gross <mgross@...ux.intel.com>,
Mike Rapoport <rppt@...nel.org>,
Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>,
Tony Luck <tony.luck@...el.com>,
Vineela Tummalapalli <vineela.tummalapalli@...el.com>,
Waiman Long <longman@...hat.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] x86/speculation: Allow IBPB to be conditionally
enabled on CPUs with always-on STIBP
On Tue, 3 Nov 2020 at 21:58, Borislav Petkov <bp@...en8.de> wrote:
>
> On Mon, Nov 02, 2020 at 11:02:10AM +1100, Anand K. Mistry wrote:
> > > I like the idea of passing in the mode you want to check, but it appears
> > > they are never used independently. The ibpb and stibp modes are always
> > > checked together in one of the if statements below, so you could make this
> > > a function that checks both modes and just have a single call. I'll leave
> > > that up to the maintainers to see what is preferred.
> >
> > I can see both sides to this. Personally, I think I prefer it as-is
> > since I think it improves readability a bit by making the conditions
> > less complicated whilst not hiding too many details. I'll wait to see
> > what others say before changing this one.
>
> Yes, but if you make it a single function with a descriptive name, you'd
> make the call sites even more readable:
>
> if (!is_spec_ib_conditional(..))
> bla;
>
> or
>
> if (!is_spec_ib_user_controlled(..))
> blu;
>
> and that function should simply check both spectre_v2_user_ibpb *and*
> spectre_v2_user_stibp in one go.
>
> Why should we do that?
>
> Exactly because you both got your brains twisted just from looking at
> this. Because this mitigation crap is such an ugly and complex maze that
> we would take even the smallest simplification any day of the week!
Ok then, two votes for. I'll make the change in v2 and post that up today.
>
> Welcome to my life since meltdown. Brain twist feels good, doesn't it?
I don't think "feels good" are the words I'd use.
>
> :-)))
>
> Thx.
>
> --
> Regards/Gruss,
> Boris.
>
> https://people.kernel.org/tglx/notes-about-netiquette
--
Anand K. Mistry
Software Engineer
Google Australia
Powered by blists - more mailing lists