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: <20181129144430.GK32259@char.us.oracle.com>
Date:   Thu, 29 Nov 2018 09:44:30 -0500
From:   Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     LKML <linux-kernel@...r.kernel.org>, x86@...nel.org,
        Peter Zijlstra <peterz@...radead.org>,
        Andy Lutomirski <luto@...nel.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Jiri Kosina <jkosina@...e.cz>,
        Tom Lendacky <thomas.lendacky@....com>,
        Josh Poimboeuf <jpoimboe@...hat.com>,
        Andrea Arcangeli <aarcange@...hat.com>,
        David Woodhouse <dwmw@...zon.co.uk>,
        Tim Chen <tim.c.chen@...ux.intel.com>,
        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>,
        Greg KH <gregkh@...uxfoundation.org>,
        Dave Stewart <david.c.stewart@...el.com>,
        Kees Cook <keescook@...omium.org>
Subject: Re: [patch V2 10/28] sched/smt: Expose sched_smt_present static key

On Sun, Nov 25, 2018 at 07:33:38PM +0100, Thomas Gleixner wrote:
> Make the scheduler's 'sched_smt_present' static key globaly available, so
> it can be used in the x86 speculation control code.
> 
> Provide a query function and a stub for the CONFIG_SMP=n case.
> 
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>

> ---
> 
> v1 -> v2: Move SMT stuff to separate header. Unbreaks ia64 build
> 
> ---
>  include/linux/sched/smt.h |   18 ++++++++++++++++++
>  kernel/sched/sched.h      |    4 +---
>  2 files changed, 19 insertions(+), 3 deletions(-)
> 
> --- /dev/null
> +++ b/include/linux/sched/smt.h
> @@ -0,0 +1,18 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +#ifndef _LINUX_SCHED_SMT_H
> +#define _LINUX_SCHED_SMT_H
> +
> +#include <linux/static_key.h>
> +
> +#ifdef CONFIG_SCHED_SMT
> +extern struct static_key_false sched_smt_present;
> +
> +static __always_inline bool sched_smt_active(void)
> +{
> +	return static_branch_likely(&sched_smt_present);
> +}
> +#else
> +static inline bool sched_smt_active(void) { return false; }
> +#endif
> +
> +#endif
> --- a/kernel/sched/sched.h
> +++ b/kernel/sched/sched.h
> @@ -23,6 +23,7 @@
>  #include <linux/sched/prio.h>
>  #include <linux/sched/rt.h>
>  #include <linux/sched/signal.h>
> +#include <linux/sched/smt.h>
>  #include <linux/sched/stat.h>
>  #include <linux/sched/sysctl.h>
>  #include <linux/sched/task.h>
> @@ -936,9 +937,6 @@ static inline int cpu_of(struct rq *rq)
>  
>  
>  #ifdef CONFIG_SCHED_SMT
> -
> -extern struct static_key_false sched_smt_present;
> -
>  extern void __update_idle_core(struct rq *rq);
>  
>  static inline void update_idle_core(struct rq *rq)
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ