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 ; 09 Oct 2019 13:12:58 -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 1iIBlx-0003H4-7q for speck@linutronix.de; Wed, 09 Oct 2019 15:12:57 +0200 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id EC9A0B186 for ; Wed, 9 Oct 2019 13:12:51 +0000 (UTC) Date: Wed, 9 Oct 2019 15:12:51 +0200 From: Michal Hocko Subject: [MODERATED] Re: ***UNCHECKED*** [PATCH v5 08/11] TAAv5 8 Message-ID: <20191009131251.GD6616@dhcp22.suse.cz> References: =?utf-8?q?=3Cfe5ff90a8b62d19d7c37b5b5f4259a085804203c=2E1570255065=2Egi?= =?utf-8?q?t=2Epawan=2Ekumar=2Egupta=40linux=2Eintel=2Ecom=3E?= MIME-Version: 1.0 In-Reply-To: =?utf-8?q?=3Cfe5ff90a8b62d19d7c37b5b5f4259a085804203c=2E15702?= =?utf-8?q?55065=2Egit=2Epawan=2Ekumar=2Egupta=40linux=2Eintel=2Ecom=3E?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: On Fri 04-10-19 23:33:31, speck for Pawan Gupta wrote: > 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 This patch is still keeping the default for tsx=off unless I got lost in the enable/disable logic, right? The earlier arguments for going this way was that there are no real users of TSX in production. This is not really the case though. At least SAP HANA seems to benefit from TSX - publicly available information can be found [1][2][3]. We have talked to SAP guys today and this is still the case. I do understand that there are likely not that many other production users of the feature but I believe that we should keep the default update friendly and sticking with the auto semantic by default is both in line with other mitigations and also reduces the risk of regressions. Thoughts? [1] https://blogs.saphana.com/2015/05/05/new-intel-xeon-haswell-processor-delivers-exceptional-performance-sap-hana-platform-2/ [2] https://blogs.saphana.com/2015/06/29/impact-of-haswell-on-hana/ [3] https://www.intel.com/content/dam/www/public/us/en/documents/solution-briefs/sap-hana-real-time-analytics-solution-brief.pdf > 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 | 9 +++++++++ > 2 files changed, 14 insertions(+) > > diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt > index 832537d59562..d7b48c38c6e5 100644 > --- a/Documentation/admin-guide/kernel-parameters.txt > +++ b/Documentation/admin-guide/kernel-parameters.txt > @@ -4821,6 +4821,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 1c0cee7a7d46..73a0e5af3720 100644 > --- a/arch/x86/kernel/cpu/tsx.c > +++ b/arch/x86/kernel/cpu/tsx.c > @@ -23,6 +23,7 @@ static enum tsx_user_cmds { > TSX_USER_CMD_NONE, > TSX_USER_CMD_ON, > TSX_USER_CMD_OFF, > + TSX_USER_CMD_AUTO, > } tsx_user_cmd = TSX_USER_CMD_NONE; > > static int __init tsx_cmdline(char *str) > @@ -38,6 +39,8 @@ static int __init tsx_cmdline(char *str) > tsx_user_cmd = TSX_USER_CMD_ON; > else if (!strcmp(str, "off")) > tsx_user_cmd = TSX_USER_CMD_OFF; > + else if (!strcmp(str, "auto")) > + tsx_user_cmd = TSX_USER_CMD_AUTO; > > return 0; > } > @@ -104,6 +107,12 @@ void tsx_init(struct cpuinfo_x86 *c) > case TSX_USER_CMD_OFF: > tsx_ctrl_state = TSX_CTRL_DISABLE; > break; > + case TSX_USER_CMD_AUTO: > + if (boot_cpu_has_bug(X86_BUG_TAA)) > + tsx_ctrl_state = TSX_CTRL_DISABLE; > + else > + tsx_ctrl_state = TSX_CTRL_ENABLE; > + break; > case TSX_USER_CMD_NONE: > default: > /* > -- > 2.20.1 -- Michal Hocko SUSE Labs