From 74a0b5762713a26496db72eac34fbbed46f20fce Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Tue, 16 Oct 2007 01:24:07 -0700 Subject: x86: optimize page faults like all other achitectures and kill notifier cruft x86(-64) are the last architectures still using the page fault notifier cruft for the kprobes page fault hook. This patch converts them to the proper direct calls, and removes the now unused pagefault notifier bits aswell as the cruft in kprobes.c that was related to this mess. I know Andi didn't really like this, but all other architecture maintainers agreed the direct calls are much better and besides the obvious cruft removal a common way of dealing with kprobes across architectures is important aswell. [akpm@linux-foundation.org: build fix] [akpm@linux-foundation.org: fix sparc64] Signed-off-by: Christoph Hellwig Cc: Andi Kleen Cc: Cc: Prasanna S Panchamukhi Cc: Ananth N Mavinakayanahalli Cc: Anil S Keshavamurthy Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-x86/kdebug_32.h | 6 ------ include/asm-x86/kdebug_64.h | 6 +----- include/asm-x86/kprobes_32.h | 2 +- include/asm-x86/kprobes_64.h | 1 - 4 files changed, 2 insertions(+), 13 deletions(-) (limited to 'include/asm-x86') diff --git a/include/asm-x86/kdebug_32.h b/include/asm-x86/kdebug_32.h index a185b5f73e7..181d437eef4 100644 --- a/include/asm-x86/kdebug_32.h +++ b/include/asm-x86/kdebug_32.h @@ -5,14 +5,9 @@ * Aug-05 2004 Ported by Prasanna S Panchamukhi * from x86_64 architecture. */ -#include struct pt_regs; -extern int register_page_fault_notifier(struct notifier_block *); -extern int unregister_page_fault_notifier(struct notifier_block *); - - /* Grossly misnamed. */ enum die_val { DIE_OOPS = 1, @@ -27,7 +22,6 @@ enum die_val { DIE_GPF, DIE_CALL, DIE_NMI_IPI, - DIE_PAGE_FAULT, }; #endif diff --git a/include/asm-x86/kdebug_64.h b/include/asm-x86/kdebug_64.h index d7e2bcf49e4..df413e05375 100644 --- a/include/asm-x86/kdebug_64.h +++ b/include/asm-x86/kdebug_64.h @@ -1,13 +1,10 @@ #ifndef _X86_64_KDEBUG_H #define _X86_64_KDEBUG_H 1 -#include +#include struct pt_regs; -extern int register_page_fault_notifier(struct notifier_block *); -extern int unregister_page_fault_notifier(struct notifier_block *); - /* Grossly misnamed. */ enum die_val { DIE_OOPS = 1, @@ -22,7 +19,6 @@ enum die_val { DIE_GPF, DIE_CALL, DIE_NMI_IPI, - DIE_PAGE_FAULT, }; extern void printk_address(unsigned long address); diff --git a/include/asm-x86/kprobes_32.h b/include/asm-x86/kprobes_32.h index 06f7303c30c..f2489d07ce8 100644 --- a/include/asm-x86/kprobes_32.h +++ b/include/asm-x86/kprobes_32.h @@ -43,7 +43,6 @@ typedef u8 kprobe_opcode_t; : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR))) #define ARCH_SUPPORTS_KRETPROBES -#define ARCH_INACTIVE_KPROBE_COUNT 0 #define flush_insn_slot(p) do { } while (0) void arch_remove_kprobe(struct kprobe *p); @@ -89,4 +88,5 @@ static inline void restore_interrupts(struct pt_regs *regs) extern int kprobe_exceptions_notify(struct notifier_block *self, unsigned long val, void *data); +extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr); #endif /* _ASM_KPROBES_H */ diff --git a/include/asm-x86/kprobes_64.h b/include/asm-x86/kprobes_64.h index 7db825403e0..3f495e5308b 100644 --- a/include/asm-x86/kprobes_64.h +++ b/include/asm-x86/kprobes_64.h @@ -42,7 +42,6 @@ typedef u8 kprobe_opcode_t; : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR))) #define ARCH_SUPPORTS_KRETPROBES -#define ARCH_INACTIVE_KPROBE_COUNT 1 void kretprobe_trampoline(void); extern void arch_remove_kprobe(struct kprobe *p); -- cgit v1.2.3