diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-16 21:15:18 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-16 21:15:18 -0700 |
commit | 5b58e21a27028a9f0399449d8bc8494fd9d9ff70 (patch) | |
tree | fba49cc745f791755a7e86d518376a740fd39f0a /arch/ia64/mm/fault.c | |
parent | 52ade9b3b97fd3bea42842a056fe0786c28d0555 (diff) | |
parent | 576fe0bd7e52dce7afb6b9b2450744555b2eb53a (diff) | |
download | op-kernel-dev-5b58e21a27028a9f0399449d8bc8494fd9d9ff70.zip op-kernel-dev-5b58e21a27028a9f0399449d8bc8494fd9d9ff70.tar.gz |
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6:
[IA64] optimize pagefaults a little
[IA64] Fix section conflict of ia64_mlogbuf_finish
[IA64] s/scalibility/scalability/
[IA64] kdump on INIT needs multi-nodes sync-up (v.2)
[IA64] wire up {signal,timer,event}fd syscalls
[IA64] spelling fixes: arch/ia64/
Diffstat (limited to 'arch/ia64/mm/fault.c')
-rw-r--r-- | arch/ia64/mm/fault.c | 41 |
1 files changed, 14 insertions, 27 deletions
diff --git a/arch/ia64/mm/fault.c b/arch/ia64/mm/fault.c index 21658e0..b87f785 100644 --- a/arch/ia64/mm/fault.c +++ b/arch/ia64/mm/fault.c @@ -19,36 +19,24 @@ extern void die (char *, struct pt_regs *, long); #ifdef CONFIG_KPROBES -ATOMIC_NOTIFIER_HEAD(notify_page_fault_chain); - -/* Hook to register for page fault notifications */ -int register_page_fault_notifier(struct notifier_block *nb) -{ - return atomic_notifier_chain_register(¬ify_page_fault_chain, nb); -} - -int unregister_page_fault_notifier(struct notifier_block *nb) +static inline int notify_page_fault(struct pt_regs *regs, int trap) { - return atomic_notifier_chain_unregister(¬ify_page_fault_chain, nb); -} + int ret = 0; + + if (!user_mode(regs)) { + /* kprobe_running() needs smp_processor_id() */ + preempt_disable(); + if (kprobe_running() && kprobes_fault_handler(regs, trap)) + ret = 1; + preempt_enable(); + } -static inline int notify_page_fault(enum die_val val, const char *str, - struct pt_regs *regs, long err, int trap, int sig) -{ - struct die_args args = { - .regs = regs, - .str = str, - .err = err, - .trapnr = trap, - .signr = sig - }; - return atomic_notifier_call_chain(¬ify_page_fault_chain, val, &args); + return ret; } #else -static inline int notify_page_fault(enum die_val val, const char *str, - struct pt_regs *regs, long err, int trap, int sig) +static inline int notify_page_fault(struct pt_regs *regs, int trap) { - return NOTIFY_DONE; + return 0; } #endif @@ -117,8 +105,7 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *re /* * This is to handle the kprobes on user space access instructions */ - if (notify_page_fault(DIE_PAGE_FAULT, "page fault", regs, code, TRAP_BRKPT, - SIGSEGV) == NOTIFY_STOP) + if (notify_page_fault(regs, TRAP_BRKPT)) return; down_read(&mm->mmap_sem); |