All of lore.kernel.org
 help / color / mirror / Atom feed
From: Waiman Long <longman@redhat.com>
To: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org
Cc: linux-kernel@vger.kernel.org,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Mark Gross <mgross@linux.intel.com>,
	Tony Luck <tony.luck@intel.com>, Waiman Long <longman@redhat.com>
Subject: [PATCH v2 2/2] x86/speculation: Fix redundant MDS mitigation message
Date: Fri, 15 Nov 2019 11:14:45 -0500	[thread overview]
Message-ID: <20191115161445.30809-3-longman@redhat.com> (raw)
In-Reply-To: <20191115161445.30809-1-longman@redhat.com>

Since MDS and TAA mitigations are inter-related for processors that are
affected by both vulnerabilities, the followiing confusing messages can
be printed in the kernel log:

  MDS: Vulnerable
  MDS: Mitigation: Clear CPU buffers

To avoid the first incorrect message, the printing of MDS mitigation
is now deferred after the TAA mitigation selection has been done.
However, that has the side effect of printing TAA mitigation first
before MDS mitigation.

Suggested-by: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
Signed-off-by: Waiman Long <longman@redhat.com>
---
 arch/x86/kernel/cpu/bugs.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index cb513eaa0df1..5966a52b359f 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -39,6 +39,7 @@ static void __init spectre_v2_select_mitigation(void);
 static void __init ssb_select_mitigation(void);
 static void __init l1tf_select_mitigation(void);
 static void __init mds_select_mitigation(void);
+static void __init mds_print_mitigation(void);
 static void __init taa_select_mitigation(void);
 
 /* The base value of the SPEC_CTRL MSR that always has to be preserved. */
@@ -108,6 +109,12 @@ void __init check_bugs(void)
 	mds_select_mitigation();
 	taa_select_mitigation();
 
+	/*
+	 * As MDS and TAA mitigations are inter-related, defer printing MDS
+	 * mitigation until after TAA mitigation selection is done.
+	 */
+	mds_print_mitigation();
+
 	arch_smt_update();
 
 #ifdef CONFIG_X86_32
@@ -245,7 +252,10 @@ static void __init mds_select_mitigation(void)
 		    (mds_nosmt || cpu_mitigations_auto_nosmt()))
 			cpu_smt_disable(false);
 	}
+}
 
+static void __init mds_print_mitigation(void)
+{
 	pr_info("%s\n", mds_strings[mds_mitigation]);
 }
 
-- 
2.18.1


  parent reply	other threads:[~2019-11-15 16:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-15 16:14 [PATCH v2 0/2] x86/speculation: Fix incorrect MDS/TAA mitigation status Waiman Long
2019-11-15 16:14 ` [PATCH v2 1/2] " Waiman Long
2019-11-15 17:09   ` Boris Petkov
2019-11-15 19:35     ` Thomas Gleixner
2019-11-15 20:21       ` Boris Petkov
2019-11-18  1:17         ` Waiman Long
2019-11-16 12:25   ` [tip: x86/pti] " tip-bot2 for Waiman Long
2019-11-15 16:14 ` Waiman Long [this message]
2019-11-16 12:25   ` [tip: x86/pti] x86/speculation: Fix redundant MDS mitigation message tip-bot2 for Waiman Long
2019-11-16 14:24     ` Borislav Petkov
2019-11-18  1:22       ` Waiman Long
2019-11-16 14:38   ` tip-bot2 for Waiman Long
2019-11-15 16:17 ` [PATCH v2 0/2] x86/speculation: Fix incorrect MDS/TAA mitigation status Waiman Long

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191115161445.30809-3-longman@redhat.com \
    --to=longman@redhat.com \
    --cc=bp@alien8.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=hpa@zytor.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgross@linux.intel.com \
    --cc=mingo@redhat.com \
    --cc=pawan.kumar.gupta@linux.intel.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.