[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180212122852.GH25235@hirez.programming.kicks-ass.net>
Date: Mon, 12 Feb 2018 13:28:52 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Ingo Molnar <mingo@...nel.org>
Cc: hpa@...or.com, tglx@...utronix.de, torvalds@...ux-foundation.org,
linux-kernel@...r.kernel.org, dwmw@...zon.co.uk,
linux-tip-commits@...r.kernel.org, Dave Hansen <dave@...1.net>,
Borislav Petkov <bp@...en8.de>,
Arjan van de Ven <arjan@...radead.org>
Subject: Re: [tip:x86/pti] x86/speculation: Use IBRS if available before
calling into firmware
On Mon, Feb 12, 2018 at 12:50:02PM +0100, Peter Zijlstra wrote:
> On Mon, Feb 12, 2018 at 11:22:11AM +0100, Ingo Molnar wrote:
> > > +static inline void firmware_restrict_branch_speculation_start(void)
> > > +{
> > > + alternative_msr_write(MSR_IA32_SPEC_CTRL, SPEC_CTRL_IBRS,
> > > + X86_FEATURE_USE_IBRS_FW);
> > > +}
> > > +
> > > +static inline void firmware_restrict_branch_speculation_end(void)
> > > +{
> > > + alternative_msr_write(MSR_IA32_SPEC_CTRL, 0,
> > > + X86_FEATURE_USE_IBRS_FW);
> >
> > BTW., there's a detail that only occurred to me today, this enabling/disabling
> > sequence is not NMI safe, and it might be called from NMI context:
>
> Wait, we're doing firmware from NMI? That sounds like a _REALLY_ bad
> idea.
Argh, its that stupid watchdog driver again.. Not only does it call
firmware, it also uses (!raw) spinlock.
Powered by blists - more mailing lists