From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linutronix.de (146.0.238.70:993) by crypto-ml.lab.linutronix.de with IMAP4-SSL for ; 24 Feb 2019 15:12:06 -0000 Received: from mga02.intel.com ([134.134.136.20]) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1gxvO1-0001RU-Iw for speck@linutronix.de; Sun, 24 Feb 2019 16:08:14 +0100 From: Andi Kleen Subject: [MODERATED] [PATCH v6 21/43] MDSv6 Date: Sun, 24 Feb 2019 07:07:27 -0800 Message-Id: <98f7c0f06b1e36a30b1f45e92890bd1ac84cd4e8.1551019522.git.ak@linux.intel.com> In-Reply-To: References: In-Reply-To: References: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 To: speck@linutronix.de Cc: Andi Kleen List-ID: Schedule a clear cpu on next kernel exit for string PIO or memcpy_from/to_io calls, when they are called in interrupts. The PIO case is likely already handled by old drivers not opting in their interrupt handlers to not clear, but let's do it just to be sure. Signed-off-by: Andi Kleen --- arch/x86/include/asm/io.h | 3 +++ include/asm-generic/io.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h index 686247db3106..19e2208eaa94 100644 --- a/arch/x86/include/asm/io.h +++ b/arch/x86/include/asm/io.h @@ -40,6 +40,7 @@ #include #include +#include #include #include #include @@ -321,6 +322,7 @@ static inline void outs##bwl(int port, const void *addr, unsigned long count) \ : "+S"(addr), "+c"(count) \ : "d"(port) : "memory"); \ } \ + lazy_clear_cpu_interrupt(); \ } \ \ static inline void ins##bwl(int port, void *addr, unsigned long count) \ @@ -337,6 +339,7 @@ static inline void ins##bwl(int port, void *addr, unsigned long count) \ : "+D"(addr), "+c"(count) \ : "d"(port) : "memory"); \ } \ + lazy_clear_cpu_interrupt(); \ } BUILDIO(b, b, char) diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h index d356f802945a..cf58bceea042 100644 --- a/include/asm-generic/io.h +++ b/include/asm-generic/io.h @@ -14,6 +14,7 @@ #include /* I/O is all done through memory accesses */ #include /* for memset() and memcpy() */ #include +#include #ifdef CONFIG_GENERIC_IOMAP #include @@ -1115,6 +1116,7 @@ static inline void memcpy_fromio(void *buffer, size_t size) { memcpy(buffer, __io_virt(addr), size); + lazy_clear_cpu_interrupt(); } #endif @@ -1132,6 +1134,7 @@ static inline void memcpy_toio(volatile void __iomem *addr, const void *buffer, size_t size) { memcpy(__io_virt(addr), buffer, size); + lazy_clear_cpu_interrupt(); } #endif -- 2.17.2