From 40edf69be7c9f8e28db5889348dfc866ceaca274 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 24 Jul 2009 15:23:05 +0200 Subject: [PATCH] x86-decouple-page-fault-logic commit 9a55d5ea74093fb07569e05f25d8e773c9bb2993 in tip. Signed-off-by: Thomas Gleixner Signed-off-by: Paul Gortmaker --- arch/x86/mm/fault.c | 2 +- arch/x86/mm/iomap_32.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletions(-) diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index f627779..ed046ed 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c @@ -1035,7 +1035,7 @@ do_page_fault(struct pt_regs *regs, unsigned long error_code) * If we're in an interrupt, have no user context or are running * in an atomic region then we must not take the fault: */ - if (unlikely(in_atomic() || !mm)) { + if (unlikely(in_atomic() || !mm || current->pagefault_disabled)) { bad_area_nosemaphore(regs, error_code, address); return; } diff --git a/arch/x86/mm/iomap_32.c b/arch/x86/mm/iomap_32.c index 84e236c..715d822 100644 --- a/arch/x86/mm/iomap_32.c +++ b/arch/x86/mm/iomap_32.c @@ -60,6 +60,7 @@ void *kmap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot) enum fixed_addresses idx; unsigned long vaddr; + preempt_disable(); pagefault_disable(); debug_kmap_atomic(type); @@ -106,5 +107,6 @@ iounmap_atomic(void *kvaddr, enum km_type type) kpte_clear_flush(kmap_pte-idx, vaddr); pagefault_enable(); + preempt_enable(); } EXPORT_SYMBOL_GPL(iounmap_atomic); -- 1.7.0.4