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 21:35:16 -0000 Received: from mga14.intel.com ([192.55.52.115]) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1iN1oB-0007Ik-0y for speck@linutronix.de; Tue, 22 Oct 2019 23:35:15 +0200 Date: Tue, 22 Oct 2019 14:29:02 -0700 From: Pawan Gupta Subject: [MODERATED] Re: [PATCH v7 04/10] TAAv7 4 Message-ID: <20191022212902.GA30440@guptapadev.amr> References: <20191022165112.GK31458@zn.tnic> <20191022174452.GE29216@guptapadev.amr> <20191022190434.GR31458@zn.tnic> MIME-Version: 1.0 In-Reply-To: <20191022190434.GR31458@zn.tnic> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: On Tue, Oct 22, 2019 at 09:04:34PM +0200, speck for Borislav Petkov wrote: > On Tue, Oct 22, 2019 at 10:44:52AM -0700, speck for Pawan Gupta wrote: > > There is a small problem with this, it will set > > > > taa_mitigation = TAA_MITIGATION_TSX_DISABLE; > > > > when there is no X86_BUG_TAA. > > And? > > When the CPU doesn't support TSX, then this practically is "Mitigation: > TSX disabled" because, well, TSX *is* disabled. Side effect of RTM check ahead of X86_BUG_TAA will be a dmesg print "Mitigation: TSX disabled" when X86_BUG_TAA is not set. > > Also, from all the possible settings: > > [TAA_MITIGATION_OFF] = "Vulnerable", > [TAA_MITIGATION_UCODE_NEEDED] = "Vulnerable: Clear CPU buffers attempted, no microcode", > [TAA_MITIGATION_VERW] = "Mitigation: Clear CPU buffers", > [TAA_MITIGATION_TSX_DISABLE] = "Mitigation: TSX disabled", > > TAA_MITIGATION_TSX_DISABLE is the one that fits best for the !RTM case, > no? When X86_BUG_TAA is not set sysfs shows "Not affected" irrespective of value of taa_mitigation. cpu_show_common() { if (!boot_cpu_has_bug(bug)) return sprintf(buf, "Not affected\n"); [...] Thanks, Pawan