summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorGuo Ren <guoren@linux.alibaba.com>2020-12-28 14:01:00 +0100
committerGuo Ren <guoren@linux.alibaba.com>2021-01-12 02:52:41 +0100
commit06f3f764417b04db765cbdee2dfeaef29fa52214 (patch)
tree7a6430d1afa5c24c60e52194daed8731e89d2017 /arch
parentcsky: Fixup update_mmu_cache called with user io mapping (diff)
downloadlinux-06f3f764417b04db765cbdee2dfeaef29fa52214.tar.xz
linux-06f3f764417b04db765cbdee2dfeaef29fa52214.zip
csky: Add faulthandler_disabled() check
Similar to other architectures: In addition to in_atomic, we also need pagefault_disabled() to check. Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/csky/mm/fault.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/csky/mm/fault.c b/arch/csky/mm/fault.c
index cecca6729b04..9533bd8d9a6a 100644
--- a/arch/csky/mm/fault.c
+++ b/arch/csky/mm/fault.c
@@ -143,12 +143,11 @@ asmlinkage void do_page_fault(struct pt_regs *regs)
return;
}
- perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address);
/*
* If we're in an interrupt or have no user
* context, we must not take the fault..
*/
- if (in_atomic() || !mm)
+ if (unlikely(faulthandler_disabled() || !mm))
goto bad_area_nosemaphore;
if (user_mode(regs))
@@ -157,6 +156,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs)
if (is_write(regs))
flags |= FAULT_FLAG_WRITE;
+ perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address);
retry:
mmap_read_lock(mm);
vma = find_vma(mm, address);