From: Zhenzhong Duan <zhenzhong.duan@oracle.com>
To: linux-kernel@vger.kernel.org
Cc: tglx@linutronix.de, mingo@kernel.org, bp@alien8.de,
x86@kernel.org, hpa@zytor.com, jgross@suse.com,
ndesaulniers@google.com, gregkh@linuxfoundation.org,
Zhenzhong Duan <zhenzhong.duan@oracle.com>
Subject: [PATCH v2] x86/speculation/mds: Eliminate leaks by trace_hardirqs_on()
Date: Sun, 23 Jun 2019 11:35:04 +0800 [thread overview]
Message-ID: <1561260904-29669-2-git-send-email-zhenzhong.duan@oracle.com> (raw)
In-Reply-To: <1561260904-29669-1-git-send-email-zhenzhong.duan@oracle.com>
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>
---
-v2: remove pointless changes which made a double flush
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 eb0f80c..e28f8b7 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));
--
1.8.3.1
next prev parent reply other threads:[~2019-06-24 3:32 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 ` Zhenzhong Duan [this message]
2019-06-26 13:07 ` [tip:x86/pti] x86/speculation/mds: Eliminate leaks by trace_hardirqs_on() tip-bot for Zhenzhong Duan
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=1561260904-29669-2-git-send-email-zhenzhong.duan@oracle.com \
--to=zhenzhong.duan@oracle.com \
--cc=bp@alien8.de \
--cc=gregkh@linuxfoundation.org \
--cc=hpa@zytor.com \
--cc=jgross@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=ndesaulniers@google.com \
--cc=tglx@linutronix.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®