Commit 7ecb344a authored by Martin Schwidefsky's avatar Martin Schwidefsky Committed by Martin Schwidefsky

[S390] Improve notify_page_fault implementation.

notify_page_fault does a preempt_disable/preempt_enable for each
fault generated by a kernel access to user space. If kprobes
is not active that is unnecessary since the interrupts are not
reenabled yet. To play safe repeat the kprobe_running check after
preempt_disable().
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent b11b5334
...@@ -52,11 +52,11 @@ ...@@ -52,11 +52,11 @@
extern int sysctl_userprocess_debug; extern int sysctl_userprocess_debug;
#endif #endif
#ifdef CONFIG_KPROBES static inline int notify_page_fault(struct pt_regs *regs)
static inline int notify_page_fault(struct pt_regs *regs, long err)
{ {
int ret = 0; int ret = 0;
#ifdef CONFIG_KPROBES
/* kprobe_running() needs smp_processor_id() */ /* kprobe_running() needs smp_processor_id() */
if (!user_mode(regs)) { if (!user_mode(regs)) {
preempt_disable(); preempt_disable();
...@@ -64,15 +64,9 @@ static inline int notify_page_fault(struct pt_regs *regs, long err) ...@@ -64,15 +64,9 @@ static inline int notify_page_fault(struct pt_regs *regs, long err)
ret = 1; ret = 1;
preempt_enable(); preempt_enable();
} }
#endif
return ret; return ret;
} }
#else
static inline int notify_page_fault(struct pt_regs *regs, long err)
{
return 0;
}
#endif
/* /*
...@@ -274,7 +268,7 @@ do_exception(struct pt_regs *regs, unsigned long error_code, int write, ...@@ -274,7 +268,7 @@ do_exception(struct pt_regs *regs, unsigned long error_code, int write,
int si_code; int si_code;
int fault; int fault;
if (notify_page_fault(regs, error_code)) if (notify_page_fault(regs))
return; return;
tsk = current; tsk = current;
......
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