From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linutronix.de (193.142.43.55:993) by crypto-ml.lab.linutronix.de with IMAP4-SSL for ; 22 Oct 2019 07:58:45 -0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1iMp3z-0001qS-Pk for speck@linutronix.de; Tue, 22 Oct 2019 09:58:45 +0200 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D2A49B86D for ; Tue, 22 Oct 2019 07:58:29 +0000 (UTC) Date: Tue, 22 Oct 2019 09:58:29 +0200 From: Michal Hocko Subject: [MODERATED] Re: ***UNCHECKED*** [PATCH v7 07/10] TAAv7 7 Message-ID: <20191022075829.GX9379@dhcp22.suse.cz> References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: On Mon 21-10-19 13:29:02, speck for Pawan Gupta wrote: > From: Pawan Gupta > Subject: [PATCH v7 07/10] x86/tsx: Add "auto" option to TSX cmdline parameter > > Platforms which are not affected by X86_BUG_TAA may want the TSX feature > enabled. Add "auto" option to the TSX cmdline parameter. When tsx=auto > disable TSX when X86_BUG_TAA is present, otherwise enable TSX. > > More details on X86_BUG_TAA can be found here: > https://www.kernel.org/doc/html/latest/admin-guide/hw-vuln/tsx_async_abort.html Considering how the whole thing is confusing could you please explicitly state CPU models where auto is different from on as you did in an email in previous email thread? > Signed-off-by: Pawan Gupta > Reviewed-by: Tony Luck > Tested-by: Neelima Krishnan > --- > Documentation/admin-guide/kernel-parameters.txt | 5 +++++ > arch/x86/kernel/cpu/tsx.c | 5 +++++ > 2 files changed, 10 insertions(+) > > diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt > index ad6b69057bb0..4d63dc8dc2fc 100644 > --- a/Documentation/admin-guide/kernel-parameters.txt > +++ b/Documentation/admin-guide/kernel-parameters.txt > @@ -4856,6 +4856,11 @@ > > on - Enable TSX on the system. > off - Disable TSX on the system. > + auto - Disable TSX if X86_BUG_TAA is present, > + otherwise enable TSX on the system. > + > + More details on X86_BUG_TAA are here: > + Documentation/admin-guide/hw-vuln/tsx_async_abort.rst > > Not specifying this option is equivalent to tsx=off. > > diff --git a/arch/x86/kernel/cpu/tsx.c b/arch/x86/kernel/cpu/tsx.c > index d031a8b6fb0e..9d7d3ad324b7 100644 > --- a/arch/x86/kernel/cpu/tsx.c > +++ b/arch/x86/kernel/cpu/tsx.c > @@ -79,6 +79,11 @@ void __init tsx_init(void) > tsx_ctrl_state = TSX_CTRL_ENABLE; > } else if (!strcmp(arg, "off")) { > tsx_ctrl_state = TSX_CTRL_DISABLE; > + } else if (!strcmp(arg, "auto")) { > + if (boot_cpu_has_bug(X86_BUG_TAA)) > + tsx_ctrl_state = TSX_CTRL_DISABLE; > + else > + tsx_ctrl_state = TSX_CTRL_ENABLE; > } else { > tsx_ctrl_state = TSX_CTRL_DISABLE; > pr_err("tsx: invalid option, defaulting to off\n"); > -- > 2.20.1 -- Michal Hocko SUSE Labs