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.1811191340270.1537@nanos.tec.linutronix.de>
Date:   Mon, 19 Nov 2018 13:48:16 +0100 (CET)
From:   Thomas Gleixner <tglx@...utronix.de>
To:     Tim Chen <tim.c.chen@...ux.intel.com>
cc:     Jiri Kosina <jikos@...nel.org>,
        Tom Lendacky <thomas.lendacky@....com>,
        Ingo Molnar <mingo@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        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>,
        LKML <linux-kernel@...r.kernel.org>, x86@...nel.org,
        Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [Patch v5 09/16] x86/smt: Convert cpu_smt_control check to
 cpu_smt_enabled static key

Tim,

On Fri, 16 Nov 2018, Tim Chen wrote:
>  
> +static char *l1tf_show_smt_vulnerable(void)
> +{
> +	if (static_branch_likely(&cpu_smt_enabled))
> +		return "vulnerable";
> +	else
> +		return "disabled";

so an UP kernel will now report vulnerable.

> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -11607,7 +11607,7 @@ static int vmx_vm_init(struct kvm *kvm)
>  			 * Warn upon starting the first VM in a potentially
>  			 * insecure environment.
>  			 */
> -			if (cpu_smt_control == CPU_SMT_ENABLED)
> +			if (static_branch_likely(&cpu_smt_enabled))
>  				pr_warn_once(L1TF_MSG_SMT);

Ditto.

>  #if defined(CONFIG_SMP) && defined(CONFIG_HOTPLUG_SMT)
> -extern enum cpuhp_smt_control cpu_smt_control;
>  extern void cpu_smt_disable(bool force);
>  extern void cpu_smt_check_topology_early(void);
>  extern void cpu_smt_check_topology(void);

What about the same thing in the else path?

> diff --git a/kernel/cpu.c b/kernel/cpu.c
> index e216154..54cf3f6 100644
> --- a/kernel/cpu.c
> +++ b/kernel/cpu.c
> @@ -368,8 +368,15 @@ static void lockdep_release_cpus_lock(void)
>  #endif	/* CONFIG_HOTPLUG_CPU */
>  
>  #ifdef CONFIG_HOTPLUG_SMT
> +
> +enum cpuhp_smt_control {
> +        CPU_SMT_ENABLED,
> +        CPU_SMT_DISABLED,
> +        CPU_SMT_FORCE_DISABLED,
> +        CPU_SMT_NOT_SUPPORTED,
> +};
> +
>  enum cpuhp_smt_control cpu_smt_control __read_mostly = CPU_SMT_ENABLED;

And this needs to be global because?

> -EXPORT_SYMBOL_GPL(cpu_smt_control);

Thanks,

	tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ