Re: [PATCH v4 2/2] x86/speculation: Enable cross-hyperthread spectre v2 STIBP mitigation

2018-09-08 Thread Thomas Gleixner
On Sat, 8 Sep 2018, Thomas Gleixner wrote: > On Fri, 7 Sep 2018, Jiri Kosina wrote: > > So I will go through the whole codepath again, but I fear your suggestion > > would not work -- see the check for cpu_smt_control in stibp_needed(). We > > need to see the old (or new, depending on the

Re: [PATCH v4 2/2] x86/speculation: Enable cross-hyperthread spectre v2 STIBP mitigation

2018-09-08 Thread Thomas Gleixner
On Sat, 8 Sep 2018, Thomas Gleixner wrote: > On Fri, 7 Sep 2018, Jiri Kosina wrote: > > So I will go through the whole codepath again, but I fear your suggestion > > would not work -- see the check for cpu_smt_control in stibp_needed(). We > > need to see the old (or new, depending on the

Re: [PATCH v4 2/2] x86/speculation: Enable cross-hyperthread spectre v2 STIBP mitigation

2018-09-08 Thread Jiri Kosina
On Sat, 8 Sep 2018, Thomas Gleixner wrote: > If after changing the SMT to enable a normal hotplug operation happens > then you need to update the MSR as well. Ah, right you are, thanks. Will fix in v5. -- Jiri Kosina SUSE Labs

Re: [PATCH v4 2/2] x86/speculation: Enable cross-hyperthread spectre v2 STIBP mitigation

2018-09-08 Thread Jiri Kosina
On Sat, 8 Sep 2018, Thomas Gleixner wrote: > If after changing the SMT to enable a normal hotplug operation happens > then you need to update the MSR as well. Ah, right you are, thanks. Will fix in v5. -- Jiri Kosina SUSE Labs

Re: [PATCH v4 2/2] x86/speculation: Enable cross-hyperthread spectre v2 STIBP mitigation

2018-09-08 Thread Thomas Gleixner
On Fri, 7 Sep 2018, Jiri Kosina wrote: > On Fri, 7 Sep 2018, Thomas Gleixner wrote: > > > > + * The read-modify-write of the MSR doesn't need any race protection > > > here, > > > + * as we're running in atomic context. > > > + */ > > > +static void enable_stibp(void *info) > > > +{ > > > + u64

Re: [PATCH v4 2/2] x86/speculation: Enable cross-hyperthread spectre v2 STIBP mitigation

2018-09-08 Thread Thomas Gleixner
On Fri, 7 Sep 2018, Jiri Kosina wrote: > On Fri, 7 Sep 2018, Thomas Gleixner wrote: > > > > + * The read-modify-write of the MSR doesn't need any race protection > > > here, > > > + * as we're running in atomic context. > > > + */ > > > +static void enable_stibp(void *info) > > > +{ > > > + u64

Re: [PATCH v4 2/2] x86/speculation: Enable cross-hyperthread spectre v2 STIBP mitigation

2018-09-07 Thread Jiri Kosina
On Fri, 7 Sep 2018, Thomas Gleixner wrote: > > + * The read-modify-write of the MSR doesn't need any race protection here, > > + * as we're running in atomic context. > > + */ > > +static void enable_stibp(void *info) > > +{ > > + u64 mask; > > + rdmsrl(MSR_IA32_SPEC_CTRL, mask); > > + mask

Re: [PATCH v4 2/2] x86/speculation: Enable cross-hyperthread spectre v2 STIBP mitigation

2018-09-07 Thread Jiri Kosina
On Fri, 7 Sep 2018, Thomas Gleixner wrote: > > + * The read-modify-write of the MSR doesn't need any race protection here, > > + * as we're running in atomic context. > > + */ > > +static void enable_stibp(void *info) > > +{ > > + u64 mask; > > + rdmsrl(MSR_IA32_SPEC_CTRL, mask); > > + mask

Re: [PATCH v4 2/2] x86/speculation: Enable cross-hyperthread spectre v2 STIBP mitigation

2018-09-07 Thread Thomas Gleixner
On Thu, 6 Sep 2018, Jiri Kosina wrote: > +/* > + * The read-modify-write of the MSR doesn't need any race protection here, > + * as we're running in atomic context. > + */ > +static void enable_stibp(void *info) > +{ > + u64 mask; > + rdmsrl(MSR_IA32_SPEC_CTRL, mask); > + mask |=

Re: [PATCH v4 2/2] x86/speculation: Enable cross-hyperthread spectre v2 STIBP mitigation

2018-09-07 Thread Thomas Gleixner
On Thu, 6 Sep 2018, Jiri Kosina wrote: > +/* > + * The read-modify-write of the MSR doesn't need any race protection here, > + * as we're running in atomic context. > + */ > +static void enable_stibp(void *info) > +{ > + u64 mask; > + rdmsrl(MSR_IA32_SPEC_CTRL, mask); > + mask |=

Re: [PATCH v4 2/2] x86/speculation: Enable cross-hyperthread spectre v2 STIBP mitigation

2018-09-07 Thread Josh Poimboeuf
On Thu, Sep 06, 2018 at 10:33:39AM +0200, Jiri Kosina wrote: > +/* > + * The read-modify-write of the MSR doesn't need any race protection here, > + * as we're running in atomic context. > + */ > +static void enable_stibp(void *info) > +{ > + u64 mask; > + rdmsrl(MSR_IA32_SPEC_CTRL, mask);

Re: [PATCH v4 2/2] x86/speculation: Enable cross-hyperthread spectre v2 STIBP mitigation

2018-09-07 Thread Josh Poimboeuf
On Thu, Sep 06, 2018 at 10:33:39AM +0200, Jiri Kosina wrote: > +/* > + * The read-modify-write of the MSR doesn't need any race protection here, > + * as we're running in atomic context. > + */ > +static void enable_stibp(void *info) > +{ > + u64 mask; > + rdmsrl(MSR_IA32_SPEC_CTRL, mask);