lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.21.1811191959540.1669@nanos.tec.linutronix.de>
Date:   Mon, 19 Nov 2018 20:03:02 +0100 (CET)
From:   Thomas Gleixner <tglx@...utronix.de>
To:     Tim Chen <tim.c.chen@...ux.intel.com>
cc:     Peter Zijlstra <peterz@...radead.org>,
        Jiri Kosina <jikos@...nel.org>,
        Tom Lendacky <thomas.lendacky@....com>,
        Ingo Molnar <mingo@...hat.com>,
        Josh Poimboeuf <jpoimboe@...hat.com>,
        Andrea Arcangeli <aarcange@...hat.com>,
        David Woodhouse <dwmw@...zon.co.uk>,
        Andi Kleen <ak@...ux.intel.com>,
        Dave Hansen <dave.hansen@...el.com>,
        Casey Schaufler <casey.schaufler@...el.com>,
        Asit Mallick <asit.k.mallick@...el.com>,
        Arjan van de Ven <arjan@...ux.intel.com>,
        Jon Masters <jcm@...hat.com>,
        Waiman Long <longman9394@...il.com>,
        linux-kernel@...r.kernel.org, x86@...nel.org
Subject: Re: [Patch v5 08/16] smt: Create cpu_smt_enabled static key for SMT
 specific code

Tim,

On Mon, 19 Nov 2018, Tim Chen wrote:
> On 11/19/2018 06:57 AM, Peter Zijlstra wrote:
> > In particular, the SMT topology bits are set before we enable
> > interrrupts and similarly, are cleared after we disable interrupts for
> > the last time and die.
> 
> 
> Peter & Thomas,
> 
> Any objection if I export sched_smt_present after including
> Peter's patch and use it in spec_ctrl_update_msr instead.
> 
> Something like this?

>  
> +#ifdef CONFIG_SCHED_SMT
> +
> +extern struct static_key_false sched_smt_present;
> +
> +static inline bool cpu_smt_present(void)
> +{
> +	if (static_branch_unlikely(&sched_smt_present))
> +		return true;
> +	else
> +		return false;

What's wrong with

       return static_branch_unlikely(&sched_smt_present);

???

But that's just a stylistic nitpick. The real issue is that you prevent the
mitigation when CONFIG_SCHED_SMT=n.

Thanks,

	tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ