Messages in this thread | | | Date | Mon, 12 Feb 2018 13:28:52 +0100 | From | Peter Zijlstra <> | 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.
| |