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:10 -0000 Received: from mga01.intel.com ([192.55.52.88]) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1gxvNr-0001RE-0O for speck@linutronix.de; Sun, 24 Feb 2019 16:08:04 +0100 From: Andi Kleen Subject: [MODERATED] [PATCH v6 24/43] MDSv6 Date: Sun, 24 Feb 2019 07:07:30 -0800 Message-Id: <31a680f05623b84c19ea4fc6dc2b0694cd19f7d4.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: Some block drivers do kmap_atomic to access user data in interrupts. Add lazy_clear_cpu_interrupt to kmap_atomic to avoid having to patch these drivers. Signed-off-by: Andi Kleen --- arch/x86/mm/highmem_32.c | 3 +++ include/linux/highmem.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/arch/x86/mm/highmem_32.c b/arch/x86/mm/highmem_32.c index 0d4bdcb84da5..1a0898fa29a9 100644 --- a/arch/x86/mm/highmem_32.c +++ b/arch/x86/mm/highmem_32.c @@ -2,6 +2,7 @@ #include #include /* for totalram_pages */ #include +#include void *kmap(struct page *page) { @@ -38,6 +39,8 @@ void *kmap_atomic_prot(struct page *page, pgprot_t prot) preempt_disable(); pagefault_disable(); + lazy_clear_cpu_interrupt(); + if (!PageHighMem(page)) return page_address(page); diff --git a/include/linux/highmem.h b/include/linux/highmem.h index ea5cdbd8c2c3..6dd4a719b0c7 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h @@ -8,6 +8,7 @@ #include #include #include +#include #include @@ -92,6 +93,7 @@ static inline void *kmap_atomic(struct page *page) { preempt_disable(); pagefault_disable(); + lazy_clear_cpu_interrupt(); return page_address(page); } #define kmap_atomic_prot(page, prot) kmap_atomic(page) -- 2.17.2