aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhenzhong Duan <zhenzhong.duan@oracle.com>2019-06-23 11:35:04 +0800
committerThomas Gleixner <tglx@linutronix.de>2019-06-26 15:01:50 +0200
commitab3765a050f7bea942f114d07278e1775e38199b (patch)
tree3bfe2cbae0cfa73b09643f245fdd4180bcd667dc
parent4b972a01a7da614b4796475f933094751a295a2f (diff)
downloadlinux-cip-ab3765a050f7bea942f114d07278e1775e38199b.tar.gz
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
-rw-r--r--arch/x86/include/asm/mwait.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/include/asm/mwait.h b/arch/x86/include/asm/mwait.h
index eb0f80ce8524d4..e28f8b723b5c17 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));