aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2007-10-16 04:24:07 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 12:42:50 -0400
commit74a0b5762713a26496db72eac34fbbed46f20fce (patch)
tree4a14df7c07ebc16283454f33713519a0e10b5c43 /include
parentd5a7430ddcdb598261d70f7eb1bf450b5be52085 (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')
-rw-r--r--include/asm-avr32/kdebug.h16
-rw-r--r--include/asm-avr32/kprobes.h2
-rw-r--r--include/asm-ia64/kdebug.h15
-rw-r--r--include/asm-ia64/kprobes.h1
-rw-r--r--include/asm-powerpc/kdebug.h19
-rw-r--r--include/asm-powerpc/kprobes.h1
-rw-r--r--include/asm-s390/kdebug.h15
-rw-r--r--include/asm-s390/kprobes.h1
-rw-r--r--include/asm-sh/kdebug.h2
-rw-r--r--include/asm-sparc64/kdebug.h18
-rw-r--r--include/asm-sparc64/kprobes.h1
-rw-r--r--include/asm-x86/kdebug_32.h6
-rw-r--r--include/asm-x86/kdebug_64.h6
-rw-r--r--include/asm-x86/kprobes_32.h2
-rw-r--r--include/asm-x86/kprobes_64.h1
15 files changed, 2 insertions, 104 deletions
diff --git a/include/asm-avr32/kdebug.h b/include/asm-avr32/kdebug.h
index 7f54e2b15d13..fd7e99046b2f 100644
--- a/include/asm-avr32/kdebug.h
+++ b/include/asm-avr32/kdebug.h
@@ -1,26 +1,10 @@
1#ifndef __ASM_AVR32_KDEBUG_H 1#ifndef __ASM_AVR32_KDEBUG_H
2#define __ASM_AVR32_KDEBUG_H 2#define __ASM_AVR32_KDEBUG_H
3 3
4#include <linux/notifier.h>
5
6/* Grossly misnamed. */ 4/* Grossly misnamed. */
7enum die_val { 5enum die_val {
8 DIE_BREAKPOINT, 6 DIE_BREAKPOINT,
9 DIE_SSTEP, 7 DIE_SSTEP,
10}; 8};
11 9
12/*
13 * These are only here because kprobes.c wants them to implement a
14 * blatant layering violation. Will hopefully go away soon once all
15 * architectures are updated.
16 */
17static inline int register_page_fault_notifier(struct notifier_block *nb)
18{
19 return 0;
20}
21static inline int unregister_page_fault_notifier(struct notifier_block *nb)
22{
23 return 0;
24}
25
26#endif /* __ASM_AVR32_KDEBUG_H */ 10#endif /* __ASM_AVR32_KDEBUG_H */
diff --git a/include/asm-avr32/kprobes.h b/include/asm-avr32/kprobes.h
index 190a6377c809..0f3e636e6e4d 100644
--- a/include/asm-avr32/kprobes.h
+++ b/include/asm-avr32/kprobes.h
@@ -17,8 +17,6 @@ typedef u16 kprobe_opcode_t;
17#define BREAKPOINT_INSTRUCTION 0xd673 /* breakpoint */ 17#define BREAKPOINT_INSTRUCTION 0xd673 /* breakpoint */
18#define MAX_INSN_SIZE 2 18#define MAX_INSN_SIZE 2
19 19
20#define ARCH_INACTIVE_KPROBE_COUNT 1
21
22#define arch_remove_kprobe(p) do { } while (0) 20#define arch_remove_kprobe(p) do { } while (0)
23 21
24/* Architecture specific copy of original instruction */ 22/* Architecture specific copy of original instruction */
diff --git a/include/asm-ia64/kdebug.h b/include/asm-ia64/kdebug.h
index 320cd8e754ea..35e49407d06c 100644
--- a/include/asm-ia64/kdebug.h
+++ b/include/asm-ia64/kdebug.h
@@ -26,21 +26,6 @@
26 * 2005-Oct Keith Owens <kaos@sgi.com>. Expand notify_die to cover more 26 * 2005-Oct Keith Owens <kaos@sgi.com>. Expand notify_die to cover more
27 * events. 27 * events.
28 */ 28 */
29#include <linux/notifier.h>
30
31/*
32 * These are only here because kprobes.c wants them to implement a
33 * blatant layering violation. Will hopefully go away soon once all
34 * architectures are updated.
35 */
36static inline int register_page_fault_notifier(struct notifier_block *nb)
37{
38 return 0;
39}
40static inline int unregister_page_fault_notifier(struct notifier_block *nb)
41{
42 return 0;
43}
44 29
45enum die_val { 30enum die_val {
46 DIE_BREAK = 1, 31 DIE_BREAK = 1,
diff --git a/include/asm-ia64/kprobes.h b/include/asm-ia64/kprobes.h
index 067d9dea68f9..6c79edf24d73 100644
--- a/include/asm-ia64/kprobes.h
+++ b/include/asm-ia64/kprobes.h
@@ -83,7 +83,6 @@ struct kprobe_ctlblk {
83}; 83};
84 84
85#define ARCH_SUPPORTS_KRETPROBES 85#define ARCH_SUPPORTS_KRETPROBES
86#define ARCH_INACTIVE_KPROBE_COUNT 1
87 86
88#define SLOT0_OPCODE_SHIFT (37) 87#define SLOT0_OPCODE_SHIFT (37)
89#define SLOT1_p1_OPCODE_SHIFT (37 - (64-46)) 88#define SLOT1_p1_OPCODE_SHIFT (37 - (64-46))
diff --git a/include/asm-powerpc/kdebug.h b/include/asm-powerpc/kdebug.h
index 295f0162c608..ae6d206728af 100644
--- a/include/asm-powerpc/kdebug.h
+++ b/include/asm-powerpc/kdebug.h
@@ -2,25 +2,6 @@
2#define _ASM_POWERPC_KDEBUG_H 2#define _ASM_POWERPC_KDEBUG_H
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5/* nearly identical to x86_64/i386 code */
6
7#include <linux/notifier.h>
8
9/*
10 * These are only here because kprobes.c wants them to implement a
11 * blatant layering violation. Will hopefully go away soon once all
12 * architectures are updated.
13 */
14static inline int register_page_fault_notifier(struct notifier_block *nb)
15{
16 return 0;
17}
18static inline int unregister_page_fault_notifier(struct notifier_block *nb)
19{
20 return 0;
21}
22extern struct atomic_notifier_head powerpc_die_chain;
23
24/* Grossly misnamed. */ 5/* Grossly misnamed. */
25enum die_val { 6enum die_val {
26 DIE_OOPS = 1, 7 DIE_OOPS = 1,
diff --git a/include/asm-powerpc/kprobes.h b/include/asm-powerpc/kprobes.h
index 8b08b447d6f3..c16973d5de62 100644
--- a/include/asm-powerpc/kprobes.h
+++ b/include/asm-powerpc/kprobes.h
@@ -81,7 +81,6 @@ typedef unsigned int kprobe_opcode_t;
81#endif 81#endif
82 82
83#define ARCH_SUPPORTS_KRETPROBES 83#define ARCH_SUPPORTS_KRETPROBES
84#define ARCH_INACTIVE_KPROBE_COUNT 1
85#define flush_insn_slot(p) do { } while (0) 84#define flush_insn_slot(p) do { } while (0)
86 85
87void kretprobe_trampoline(void); 86void kretprobe_trampoline(void);
diff --git a/include/asm-s390/kdebug.h b/include/asm-s390/kdebug.h
index 04418af08f85..40db27cd6e60 100644
--- a/include/asm-s390/kdebug.h
+++ b/include/asm-s390/kdebug.h
@@ -4,24 +4,9 @@
4/* 4/*
5 * Feb 2006 Ported to s390 <grundym@us.ibm.com> 5 * Feb 2006 Ported to s390 <grundym@us.ibm.com>
6 */ 6 */
7#include <linux/notifier.h>
8 7
9struct pt_regs; 8struct pt_regs;
10 9
11/*
12 * These are only here because kprobes.c wants them to implement a
13 * blatant layering violation. Will hopefully go away soon once all
14 * architectures are updated.
15 */
16static inline int register_page_fault_notifier(struct notifier_block *nb)
17{
18 return 0;
19}
20static inline int unregister_page_fault_notifier(struct notifier_block *nb)
21{
22 return 0;
23}
24
25enum die_val { 10enum die_val {
26 DIE_OOPS = 1, 11 DIE_OOPS = 1,
27 DIE_BPT, 12 DIE_BPT,
diff --git a/include/asm-s390/kprobes.h b/include/asm-s390/kprobes.h
index 340ba10446ea..8bc67cc9ffd2 100644
--- a/include/asm-s390/kprobes.h
+++ b/include/asm-s390/kprobes.h
@@ -47,7 +47,6 @@ typedef u16 kprobe_opcode_t;
47 : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR))) 47 : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR)))
48 48
49#define ARCH_SUPPORTS_KRETPROBES 49#define ARCH_SUPPORTS_KRETPROBES
50#define ARCH_INACTIVE_KPROBE_COUNT 0
51 50
52#define KPROBE_SWAP_INST 0x10 51#define KPROBE_SWAP_INST 0x10
53 52
diff --git a/include/asm-sh/kdebug.h b/include/asm-sh/kdebug.h
index 382cfc7deb73..49cd69051a88 100644
--- a/include/asm-sh/kdebug.h
+++ b/include/asm-sh/kdebug.h
@@ -1,8 +1,6 @@
1#ifndef __ASM_SH_KDEBUG_H 1#ifndef __ASM_SH_KDEBUG_H
2#define __ASM_SH_KDEBUG_H 2#define __ASM_SH_KDEBUG_H
3 3
4#include <linux/notifier.h>
5
6/* Grossly misnamed. */ 4/* Grossly misnamed. */
7enum die_val { 5enum die_val {
8 DIE_TRAP, 6 DIE_TRAP,
diff --git a/include/asm-sparc64/kdebug.h b/include/asm-sparc64/kdebug.h
index 9974c7b0aebc..f905b773235a 100644
--- a/include/asm-sparc64/kdebug.h
+++ b/include/asm-sparc64/kdebug.h
@@ -1,26 +1,8 @@
1#ifndef _SPARC64_KDEBUG_H 1#ifndef _SPARC64_KDEBUG_H
2#define _SPARC64_KDEBUG_H 2#define _SPARC64_KDEBUG_H
3 3
4/* Nearly identical to x86_64/i386 code. */
5
6#include <linux/notifier.h>
7
8struct pt_regs; 4struct pt_regs;
9 5
10/*
11 * These are only here because kprobes.c wants them to implement a
12 * blatant layering violation. Will hopefully go away soon once all
13 * architectures are updated.
14 */
15static inline int register_page_fault_notifier(struct notifier_block *nb)
16{
17 return 0;
18}
19static inline int unregister_page_fault_notifier(struct notifier_block *nb)
20{
21 return 0;
22}
23
24extern void bad_trap(struct pt_regs *, long); 6extern void bad_trap(struct pt_regs *, long);
25 7
26/* Grossly misnamed. */ 8/* Grossly misnamed. */
diff --git a/include/asm-sparc64/kprobes.h b/include/asm-sparc64/kprobes.h
index 7f6774dca5f4..a04145b77f96 100644
--- a/include/asm-sparc64/kprobes.h
+++ b/include/asm-sparc64/kprobes.h
@@ -11,7 +11,6 @@ typedef u32 kprobe_opcode_t;
11#define MAX_INSN_SIZE 2 11#define MAX_INSN_SIZE 2
12 12
13#define arch_remove_kprobe(p) do {} while (0) 13#define arch_remove_kprobe(p) do {} while (0)
14#define ARCH_INACTIVE_KPROBE_COUNT 0
15 14
16#define flush_insn_slot(p) \ 15#define flush_insn_slot(p) \
17do { flushi(&(p)->ainsn.insn[0]); \ 16do { flushi(&(p)->ainsn.insn[0]); \
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
10struct pt_regs; 9struct pt_regs;
11 10
12extern int register_page_fault_notifier(struct notifier_block *);
13extern int unregister_page_fault_notifier(struct notifier_block *);
14
15
16/* Grossly misnamed. */ 11/* Grossly misnamed. */
17enum die_val { 12enum 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
6struct pt_regs; 6struct pt_regs;
7 7
8extern int register_page_fault_notifier(struct notifier_block *);
9extern int unregister_page_fault_notifier(struct notifier_block *);
10
11/* Grossly misnamed. */ 8/* Grossly misnamed. */
12enum die_val { 9enum 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
28extern void printk_address(unsigned long address); 24extern 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
49void arch_remove_kprobe(struct kprobe *p); 48void arch_remove_kprobe(struct kprobe *p);
@@ -89,4 +88,5 @@ static inline void restore_interrupts(struct pt_regs *regs)
89 88
90extern int kprobe_exceptions_notify(struct notifier_block *self, 89extern int kprobe_exceptions_notify(struct notifier_block *self,
91 unsigned long val, void *data); 90 unsigned long val, void *data);
91extern 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
47void kretprobe_trampoline(void); 46void kretprobe_trampoline(void);
48extern void arch_remove_kprobe(struct kprobe *p); 47extern void arch_remove_kprobe(struct kprobe *p);