[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <HE1PR0401MB2634FE1189DA2E7B8C405FECFFA80@HE1PR0401MB2634.eurprd04.prod.outlook.com>
Date: Fri, 23 Mar 2018 15:59:50 +0000
From: Diana Madalina Craciun <diana.craciun@....com>
To: Michal Suchanek <msuchanek@...e.de>,
"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>
CC: Kate Stewart <kstewart@...uxfoundation.org>,
Madhavan Srinivasan <maddy@...ux.vnet.ibm.com>,
Mahesh Salgaonkar <mahesh@...ux.vnet.ibm.com>,
Al Viro <viro@...iv.linux.org.uk>,
Paul Mackerras <paulus@...ba.org>,
Michael Neuling <mikey@...ling.org>,
"Bryant G. Ly" <bryantly@...ux.vnet.ibm.com>,
"Naveen N. Rao" <naveen.n.rao@...ux.vnet.ibm.com>,
Daniel Axtens <dja@...ens.net>,
Nicholas Piggin <npiggin@...il.com>,
Cédric Le Goater <clg@...d.org>,
David Gibson <david@...son.dropbear.id.au>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Masami Hiramatsu <mhiramat@...nel.org>,
Andrew Donnellan <andrew.donnellan@....ibm.com>,
Philippe Ombredanne <pombredanne@...b.com>,
Joe Perches <joe@...ches.com>,
Oliver O'Halloran <oohall@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
"Tobin C. Harding" <me@...in.cc>
Subject: Re: [PATCH RFC rebase 9/9] powerpc/64: barrier_nospec: Add
commandline trigger
On 3/15/2018 9:34 PM, Michal Suchanek wrote:
> Add commandline options spectre_v2 and nospectre_v2
>
> These are named same as similar x86 options regardless of actual effect
> to not require platform-specific configuration.
>
> Supported options:
> nospectre_v2 or spectre_v2=off - speculation barrier not used
> spectre_v2=on or spectre_v2=auto - speculation barrier used
Why the barrier is enabled only for spectre variant 2 mitigations? It
can be used as well for variant 1 mitigations. In fact I am not sure
that the places where it is used fall under spectre 2 at all.
>
> Changing the settings after boot is not supported and VM migration may
> change requirements so auto is same as on.
>
> Based on s390 implementation
>
> Signed-off-by: Michal Suchanek <msuchanek@...e.de>
> ---
> arch/powerpc/kernel/setup_64.c | 22 ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
> index f6678a7b6114..c74e656265df 100644
> --- a/arch/powerpc/kernel/setup_64.c
> +++ b/arch/powerpc/kernel/setup_64.c
> @@ -840,6 +840,28 @@ static int __init handle_no_pti(char *p)
> }
> early_param("nopti", handle_no_pti);
>
> +static int __init nospectre_v2_setup_early(char *str)
> +{
> + no_nospec = true;
> + return 0;
> +}
> +early_param("nospectre_v2", nospectre_v2_setup_early);
> +
> +static int __init spectre_v2_setup_early(char *str)
> +{
> + if (str && !strncmp(str, "on", 2))
> + no_nospec = false;
> +
> + if (str && !strncmp(str, "off", 3))
> + no_nospec = true;
> +
> + if (str && !strncmp(str, "auto", 4))
> + no_nospec = false;
> +
> + return 0;
> +}
> +early_param("spectre_v2", spectre_v2_setup_early);
> +
> static void do_nothing(void *unused)
> {
> /*
Thanks,
Diana
Powered by blists - more mailing lists