Return-Path: Received: from mail.linutronix.de (193.142.43.55:993) by crypto-ml.lab.linutronix.de with IMAP4-SSL for ; 10 Oct 2019 21:24:55 -0000 Received: from mga03.intel.com ([134.134.136.65]) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1iIfvZ-0003GL-9M for speck@linutronix.de; Thu, 10 Oct 2019 23:24:55 +0200 Date: Thu, 10 Oct 2019 14:18:59 -0700 From: Pawan Gupta Subject: [MODERATED] Re: [PATCH v6 5/9] TAAv6 5 Message-ID: <20191010211859.GI11840@guptapadev.amr> References: <5d9e6e22.1c69fb81.6df19.ff55SMTPIN_ADDED_BROKEN@mx.google.com> <20191010065011.GB256999@kroah.com> MIME-Version: 1.0 In-Reply-To: <20191010065011.GB256999@kroah.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: On Thu, Oct 10, 2019 at 08:50:11AM +0200, speck for Greg KH wrote: > On Wed, Oct 09, 2019 at 04:26:56PM -0700, speck for Pawan Gupta wrote: > > Add the sysfs reporting file for TSX Async Abort. It exposes the > > vulnerability and the mitigation state similar to the existing files for > > the other hardware vulnerabilities. > > > > sysfs file path is: > > /sys/devices/system/cpu/vulnerabilities/tsx_async_abort > > > > Signed-off-by: Pawan Gupta > > Reviewed-by: Mark Gross > > Reviewed-by: Tony Luck > > Tested-by: Neelima Krishnan > > --- > > arch/x86/kernel/cpu/bugs.c | 23 +++++++++++++++++++++++ > > drivers/base/cpu.c | 9 +++++++++ > > include/linux/cpu.h | 3 +++ > > 3 files changed, 35 insertions(+) > > > > diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c > > index 0b7c7a826580..073687ddd06d 100644 > > --- a/arch/x86/kernel/cpu/bugs.c > > +++ b/arch/x86/kernel/cpu/bugs.c > > @@ -1451,6 +1451,21 @@ static ssize_t mds_show_state(char *buf) > > sched_smt_active() ? "vulnerable" : "disabled"); > > } > > > > +static ssize_t tsx_async_abort_show_state(char *buf) > > +{ > > + if ((taa_mitigation == TAA_MITIGATION_TSX_DISABLE) || > > + (taa_mitigation == TAA_MITIGATION_OFF)) > > + return sprintf(buf, "%s\n", taa_strings[taa_mitigation]); > > + > > + if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) { > > + return sprintf(buf, "%s; SMT Host state unknown\n", > > + taa_strings[taa_mitigation]); > > + } > > + > > + return sprintf(buf, "%s; SMT %s\n", taa_strings[taa_mitigation], > > Shouldn't that be: > return sprintf(buf, "%s: SMT %s\n", taa_strings[taa_mitigation], > > Use a ':' and not a ';' Oh, ';' is the separator between the main mitigation and the SMT status. This is the sample output: "Mitigation: Clear CPU buffers; SMT vulnerable" ^ This follows the MDS nomenclature. Thanks, Pawan