mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Zhenzhong Duan <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: hpa@zytor.com, mingo@kernel.org, tglx@linutronix.de,
	linux-kernel@vger.kernel.org, zhenzhong.duan@oracle.com
Subject: [tip:x86/pti] x86/speculation/mds: Eliminate leaks by trace_hardirqs_on()
Date: Wed, 26 Jun 2019 06:07:49 -0700	[thread overview]
Message-ID: <tip-ab3765a050f7bea942f114d07278e1775e38199b@git.kernel.org> (raw)
In-Reply-To: <1561260904-29669-2-git-send-email-zhenzhong.duan@oracle.com>

Commit-ID:  ab3765a050f7bea942f114d07278e1775e38199b
Gitweb:     https://git.kernel.org/tip/ab3765a050f7bea942f114d07278e1775e38199b
Author:     Zhenzhong Duan <zhenzhong.duan@oracle.com>
AuthorDate: Sun, 23 Jun 2019 11:35:04 +0800
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Wed, 26 Jun 2019 15:01:50 +0200

x86/speculation/mds: Eliminate leaks by trace_hardirqs_on()

Move mds_idle_clear_cpu_buffers() after trace_hardirqs_on() to ensure
all store buffer entries are flushed.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: bp@alien8.de
Cc: hpa@zytor.com
Cc: jgross@suse.com
Cc: ndesaulniers@google.com
Cc: gregkh@linuxfoundation.org
Link: https://lkml.kernel.org/r/1561260904-29669-2-git-send-email-zhenzhong.duan@oracle.com

---
 arch/x86/include/asm/mwait.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/mwait.h b/arch/x86/include/asm/mwait.h
index eb0f80ce8524..e28f8b723b5c 100644
--- a/arch/x86/include/asm/mwait.h
+++ b/arch/x86/include/asm/mwait.h
@@ -86,9 +86,9 @@ static inline void __mwaitx(unsigned long eax, unsigned long ebx,
 
 static inline void __sti_mwait(unsigned long eax, unsigned long ecx)
 {
-	mds_idle_clear_cpu_buffers();
-
 	trace_hardirqs_on();
+
+	mds_idle_clear_cpu_buffers();
 	/* "mwait %eax, %ecx;" */
 	asm volatile("sti; .byte 0x0f, 0x01, 0xc9;"
 		     :: "a" (eax), "c" (ecx));

      reply	other threads:[~2019-06-26 13:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-23  3:35 [PATCH] x86/speculation/mds: Avoid clearing CPU buffers in native machine with old microcode Zhenzhong Duan
2019-06-23  3:35 ` [PATCH v2] x86/speculation/mds: Eliminate leaks by trace_hardirqs_on() Zhenzhong Duan
2019-06-26 13:07   ` tip-bot for Zhenzhong Duan [this message]

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=tip-ab3765a050f7bea942f114d07278e1775e38199b@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=zhenzhong.duan@oracle.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome