Commit 06f3f764 authored by Guo Ren's avatar Guo Ren

csky: Add faulthandler_disabled() check

Similar to other architectures:
In addition to in_atomic, we also need pagefault_disabled() to
check.
Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
parent 3e455cf5
...@@ -143,12 +143,11 @@ asmlinkage void do_page_fault(struct pt_regs *regs) ...@@ -143,12 +143,11 @@ asmlinkage void do_page_fault(struct pt_regs *regs)
return; return;
} }
perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address);
/* /*
* If we're in an interrupt or have no user * If we're in an interrupt or have no user
* context, we must not take the fault.. * context, we must not take the fault..
*/ */
if (in_atomic() || !mm) if (unlikely(faulthandler_disabled() || !mm))
goto bad_area_nosemaphore; goto bad_area_nosemaphore;
if (user_mode(regs)) if (user_mode(regs))
...@@ -157,6 +156,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs) ...@@ -157,6 +156,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs)
if (is_write(regs)) if (is_write(regs))
flags |= FAULT_FLAG_WRITE; flags |= FAULT_FLAG_WRITE;
perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address);
retry: retry:
mmap_read_lock(mm); mmap_read_lock(mm);
vma = find_vma(mm, address); vma = find_vma(mm, address);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment