lkml.org 
[lkml]   [2018]   [Sep]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 3/3] x86/speculation: Enable cross-hyperthread spectre v2 STIBP mitigation
On Mon, 3 Sep 2018, Peter Zijlstra wrote:
> On Mon, Sep 03, 2018 at 04:34:44PM +0200, Peter Zijlstra wrote:
> > On Mon, Sep 03, 2018 at 02:45:31PM +0200, Jiri Kosina wrote:
> >
> > > +static bool __init stibp_needed(void)
> > > +{
> > > + return (cpu_smt_control != CPU_SMT_NOT_SUPPORTED &&
> > > + boot_cpu_has(X86_FEATURE_STIBP));
> > > +}
> >
> > Should that not be:
> >
> > ((cpu_smt_control != CPU_SMT_NOT_SUPPORTED) ||
>
> s/||/&&/
>
> > (cpu_smt_control != CPU_SMT_FORCE_DISABLED)) &&
> > boot_cpu_has(X86_FEATURE_STIBP);
> >
> > instead?

At least. Ideally we update it when SMT control is switched. There is no
point to have it enabled when SMT is set to DISABLED, but then we need to
set it when enabled again. With the minimal logic above its speculatively
enabled even when not required.

Thanks,

tglx

\
 
 \ /
  Last update: 2018-09-03 17:18    [W:0.035 / U:2.884 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site