summaryrefslogtreecommitdiffstats
path: root/arch/s390/mm
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2009-12-07 12:51:44 +0100
committerMartin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com>2009-12-07 12:51:33 +0100
commit7ecb344ae80bc03397ded3b004e06ecfe32becf9 (patch)
tree2337ff84522741e9101b9a0a4cf3045a424561d3 /arch/s390/mm
parentb11b53342773361f3353b285eb6a3fd6074e7997 (diff)
downloadop-kernel-dev-7ecb344ae80bc03397ded3b004e06ecfe32becf9.zip
op-kernel-dev-7ecb344ae80bc03397ded3b004e06ecfe32becf9.tar.gz
[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: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/mm')
-rw-r--r--arch/s390/mm/fault.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index 77108e3..fd72c26 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -52,11 +52,11 @@
extern int sysctl_userprocess_debug;
#endif
-#ifdef CONFIG_KPROBES
-static inline int notify_page_fault(struct pt_regs *regs, long err)
+static inline int notify_page_fault(struct pt_regs *regs)
{
int ret = 0;
+#ifdef CONFIG_KPROBES
/* kprobe_running() needs smp_processor_id() */
if (!user_mode(regs)) {
preempt_disable();
@@ -64,15 +64,9 @@ static inline int notify_page_fault(struct pt_regs *regs, long err)
ret = 1;
preempt_enable();
}
-
+#endif
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,
int si_code;
int fault;
- if (notify_page_fault(regs, error_code))
+ if (notify_page_fault(regs))
return;
tsk = current;
OpenPOWER on IntegriCloud