diff options
author | Christoph Hellwig <hch@lst.de> | 2007-10-16 04:24:07 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 12:42:50 -0400 |
commit | 74a0b5762713a26496db72eac34fbbed46f20fce (patch) | |
tree | 4a14df7c07ebc16283454f33713519a0e10b5c43 /include/asm-x86 | |
parent | d5a7430ddcdb598261d70f7eb1bf450b5be52085 (diff) |
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 <hch@lst.de>
Cc: Andi Kleen <ak@suse.de>
Cc: <linux-arch@vger.kernel.org>
Cc: Prasanna S Panchamukhi <prasanna@in.ibm.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-x86')
-rw-r--r-- | include/asm-x86/kdebug_32.h | 6 | ||||
-rw-r--r-- | include/asm-x86/kdebug_64.h | 6 | ||||
-rw-r--r-- | include/asm-x86/kprobes_32.h | 2 | ||||
-rw-r--r-- | include/asm-x86/kprobes_64.h | 1 |
4 files changed, 2 insertions, 13 deletions
diff --git a/include/asm-x86/kdebug_32.h b/include/asm-x86/kdebug_32.h index a185b5f73e7f..181d437eef4b 100644 --- a/include/asm-x86/kdebug_32.h +++ b/include/asm-x86/kdebug_32.h | |||
@@ -5,14 +5,9 @@ | |||
5 | * Aug-05 2004 Ported by Prasanna S Panchamukhi <prasanna@in.ibm.com> | 5 | * Aug-05 2004 Ported by Prasanna S Panchamukhi <prasanna@in.ibm.com> |
6 | * from x86_64 architecture. | 6 | * from x86_64 architecture. |
7 | */ | 7 | */ |
8 | #include <linux/notifier.h> | ||
9 | 8 | ||
10 | struct pt_regs; | 9 | struct pt_regs; |
11 | 10 | ||
12 | extern int register_page_fault_notifier(struct notifier_block *); | ||
13 | extern int unregister_page_fault_notifier(struct notifier_block *); | ||
14 | |||
15 | |||
16 | /* Grossly misnamed. */ | 11 | /* Grossly misnamed. */ |
17 | enum die_val { | 12 | enum die_val { |
18 | DIE_OOPS = 1, | 13 | DIE_OOPS = 1, |
@@ -27,7 +22,6 @@ enum die_val { | |||
27 | DIE_GPF, | 22 | DIE_GPF, |
28 | DIE_CALL, | 23 | DIE_CALL, |
29 | DIE_NMI_IPI, | 24 | DIE_NMI_IPI, |
30 | DIE_PAGE_FAULT, | ||
31 | }; | 25 | }; |
32 | 26 | ||
33 | #endif | 27 | #endif |
diff --git a/include/asm-x86/kdebug_64.h b/include/asm-x86/kdebug_64.h index d7e2bcf49e4f..df413e05375e 100644 --- a/include/asm-x86/kdebug_64.h +++ b/include/asm-x86/kdebug_64.h | |||
@@ -1,13 +1,10 @@ | |||
1 | #ifndef _X86_64_KDEBUG_H | 1 | #ifndef _X86_64_KDEBUG_H |
2 | #define _X86_64_KDEBUG_H 1 | 2 | #define _X86_64_KDEBUG_H 1 |
3 | 3 | ||
4 | #include <linux/notifier.h> | 4 | #include <linux/compiler.h> |
5 | 5 | ||
6 | struct pt_regs; | 6 | struct pt_regs; |
7 | 7 | ||
8 | extern int register_page_fault_notifier(struct notifier_block *); | ||
9 | extern int unregister_page_fault_notifier(struct notifier_block *); | ||
10 | |||
11 | /* Grossly misnamed. */ | 8 | /* Grossly misnamed. */ |
12 | enum die_val { | 9 | enum die_val { |
13 | DIE_OOPS = 1, | 10 | DIE_OOPS = 1, |
@@ -22,7 +19,6 @@ enum die_val { | |||
22 | DIE_GPF, | 19 | DIE_GPF, |
23 | DIE_CALL, | 20 | DIE_CALL, |
24 | DIE_NMI_IPI, | 21 | DIE_NMI_IPI, |
25 | DIE_PAGE_FAULT, | ||
26 | }; | 22 | }; |
27 | 23 | ||
28 | extern void printk_address(unsigned long address); | 24 | extern void printk_address(unsigned long address); |
diff --git a/include/asm-x86/kprobes_32.h b/include/asm-x86/kprobes_32.h index 06f7303c30ca..f2489d07ce88 100644 --- a/include/asm-x86/kprobes_32.h +++ b/include/asm-x86/kprobes_32.h | |||
@@ -43,7 +43,6 @@ typedef u8 kprobe_opcode_t; | |||
43 | : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR))) | 43 | : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR))) |
44 | 44 | ||
45 | #define ARCH_SUPPORTS_KRETPROBES | 45 | #define ARCH_SUPPORTS_KRETPROBES |
46 | #define ARCH_INACTIVE_KPROBE_COUNT 0 | ||
47 | #define flush_insn_slot(p) do { } while (0) | 46 | #define flush_insn_slot(p) do { } while (0) |
48 | 47 | ||
49 | void arch_remove_kprobe(struct kprobe *p); | 48 | void arch_remove_kprobe(struct kprobe *p); |
@@ -89,4 +88,5 @@ static inline void restore_interrupts(struct pt_regs *regs) | |||
89 | 88 | ||
90 | extern int kprobe_exceptions_notify(struct notifier_block *self, | 89 | extern int kprobe_exceptions_notify(struct notifier_block *self, |
91 | unsigned long val, void *data); | 90 | unsigned long val, void *data); |
91 | extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr); | ||
92 | #endif /* _ASM_KPROBES_H */ | 92 | #endif /* _ASM_KPROBES_H */ |
diff --git a/include/asm-x86/kprobes_64.h b/include/asm-x86/kprobes_64.h index 7db825403e01..3f495e5308b1 100644 --- a/include/asm-x86/kprobes_64.h +++ b/include/asm-x86/kprobes_64.h | |||
@@ -42,7 +42,6 @@ typedef u8 kprobe_opcode_t; | |||
42 | : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR))) | 42 | : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR))) |
43 | 43 | ||
44 | #define ARCH_SUPPORTS_KRETPROBES | 44 | #define ARCH_SUPPORTS_KRETPROBES |
45 | #define ARCH_INACTIVE_KPROBE_COUNT 1 | ||
46 | 45 | ||
47 | void kretprobe_trampoline(void); | 46 | void kretprobe_trampoline(void); |
48 | extern void arch_remove_kprobe(struct kprobe *p); | 47 | extern void arch_remove_kprobe(struct kprobe *p); |