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>
This commit is contained in:
committed by
Linus Torvalds
parent
d5a7430ddc
commit
74a0b57627
@@ -1,26 +1,10 @@
|
||||
#ifndef __ASM_AVR32_KDEBUG_H
|
||||
#define __ASM_AVR32_KDEBUG_H
|
||||
|
||||
#include <linux/notifier.h>
|
||||
|
||||
/* Grossly misnamed. */
|
||||
enum die_val {
|
||||
DIE_BREAKPOINT,
|
||||
DIE_SSTEP,
|
||||
};
|
||||
|
||||
/*
|
||||
* These are only here because kprobes.c wants them to implement a
|
||||
* blatant layering violation. Will hopefully go away soon once all
|
||||
* architectures are updated.
|
||||
*/
|
||||
static inline int register_page_fault_notifier(struct notifier_block *nb)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline int unregister_page_fault_notifier(struct notifier_block *nb)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* __ASM_AVR32_KDEBUG_H */
|
||||
|
||||
@@ -17,8 +17,6 @@ typedef u16 kprobe_opcode_t;
|
||||
#define BREAKPOINT_INSTRUCTION 0xd673 /* breakpoint */
|
||||
#define MAX_INSN_SIZE 2
|
||||
|
||||
#define ARCH_INACTIVE_KPROBE_COUNT 1
|
||||
|
||||
#define arch_remove_kprobe(p) do { } while (0)
|
||||
|
||||
/* Architecture specific copy of original instruction */
|
||||
|
||||
@@ -26,21 +26,6 @@
|
||||
* 2005-Oct Keith Owens <kaos@sgi.com>. Expand notify_die to cover more
|
||||
* events.
|
||||
*/
|
||||
#include <linux/notifier.h>
|
||||
|
||||
/*
|
||||
* These are only here because kprobes.c wants them to implement a
|
||||
* blatant layering violation. Will hopefully go away soon once all
|
||||
* architectures are updated.
|
||||
*/
|
||||
static inline int register_page_fault_notifier(struct notifier_block *nb)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline int unregister_page_fault_notifier(struct notifier_block *nb)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
enum die_val {
|
||||
DIE_BREAK = 1,
|
||||
|
||||
@@ -83,7 +83,6 @@ struct kprobe_ctlblk {
|
||||
};
|
||||
|
||||
#define ARCH_SUPPORTS_KRETPROBES
|
||||
#define ARCH_INACTIVE_KPROBE_COUNT 1
|
||||
|
||||
#define SLOT0_OPCODE_SHIFT (37)
|
||||
#define SLOT1_p1_OPCODE_SHIFT (37 - (64-46))
|
||||
|
||||
@@ -2,25 +2,6 @@
|
||||
#define _ASM_POWERPC_KDEBUG_H
|
||||
#ifdef __KERNEL__
|
||||
|
||||
/* nearly identical to x86_64/i386 code */
|
||||
|
||||
#include <linux/notifier.h>
|
||||
|
||||
/*
|
||||
* These are only here because kprobes.c wants them to implement a
|
||||
* blatant layering violation. Will hopefully go away soon once all
|
||||
* architectures are updated.
|
||||
*/
|
||||
static inline int register_page_fault_notifier(struct notifier_block *nb)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline int unregister_page_fault_notifier(struct notifier_block *nb)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
extern struct atomic_notifier_head powerpc_die_chain;
|
||||
|
||||
/* Grossly misnamed. */
|
||||
enum die_val {
|
||||
DIE_OOPS = 1,
|
||||
|
||||
@@ -81,7 +81,6 @@ typedef unsigned int kprobe_opcode_t;
|
||||
#endif
|
||||
|
||||
#define ARCH_SUPPORTS_KRETPROBES
|
||||
#define ARCH_INACTIVE_KPROBE_COUNT 1
|
||||
#define flush_insn_slot(p) do { } while (0)
|
||||
|
||||
void kretprobe_trampoline(void);
|
||||
|
||||
@@ -4,24 +4,9 @@
|
||||
/*
|
||||
* Feb 2006 Ported to s390 <grundym@us.ibm.com>
|
||||
*/
|
||||
#include <linux/notifier.h>
|
||||
|
||||
struct pt_regs;
|
||||
|
||||
/*
|
||||
* These are only here because kprobes.c wants them to implement a
|
||||
* blatant layering violation. Will hopefully go away soon once all
|
||||
* architectures are updated.
|
||||
*/
|
||||
static inline int register_page_fault_notifier(struct notifier_block *nb)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline int unregister_page_fault_notifier(struct notifier_block *nb)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
enum die_val {
|
||||
DIE_OOPS = 1,
|
||||
DIE_BPT,
|
||||
|
||||
@@ -47,7 +47,6 @@ typedef u16 kprobe_opcode_t;
|
||||
: (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR)))
|
||||
|
||||
#define ARCH_SUPPORTS_KRETPROBES
|
||||
#define ARCH_INACTIVE_KPROBE_COUNT 0
|
||||
|
||||
#define KPROBE_SWAP_INST 0x10
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#ifndef __ASM_SH_KDEBUG_H
|
||||
#define __ASM_SH_KDEBUG_H
|
||||
|
||||
#include <linux/notifier.h>
|
||||
|
||||
/* Grossly misnamed. */
|
||||
enum die_val {
|
||||
DIE_TRAP,
|
||||
|
||||
@@ -1,26 +1,8 @@
|
||||
#ifndef _SPARC64_KDEBUG_H
|
||||
#define _SPARC64_KDEBUG_H
|
||||
|
||||
/* Nearly identical to x86_64/i386 code. */
|
||||
|
||||
#include <linux/notifier.h>
|
||||
|
||||
struct pt_regs;
|
||||
|
||||
/*
|
||||
* These are only here because kprobes.c wants them to implement a
|
||||
* blatant layering violation. Will hopefully go away soon once all
|
||||
* architectures are updated.
|
||||
*/
|
||||
static inline int register_page_fault_notifier(struct notifier_block *nb)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline int unregister_page_fault_notifier(struct notifier_block *nb)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern void bad_trap(struct pt_regs *, long);
|
||||
|
||||
/* Grossly misnamed. */
|
||||
|
||||
@@ -11,7 +11,6 @@ typedef u32 kprobe_opcode_t;
|
||||
#define MAX_INSN_SIZE 2
|
||||
|
||||
#define arch_remove_kprobe(p) do {} while (0)
|
||||
#define ARCH_INACTIVE_KPROBE_COUNT 0
|
||||
|
||||
#define flush_insn_slot(p) \
|
||||
do { flushi(&(p)->ainsn.insn[0]); \
|
||||
|
||||
@@ -5,14 +5,9 @@
|
||||
* Aug-05 2004 Ported by Prasanna S Panchamukhi <prasanna@in.ibm.com>
|
||||
* from x86_64 architecture.
|
||||
*/
|
||||
#include <linux/notifier.h>
|
||||
|
||||
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
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
#ifndef _X86_64_KDEBUG_H
|
||||
#define _X86_64_KDEBUG_H 1
|
||||
|
||||
#include <linux/notifier.h>
|
||||
#include <linux/compiler.h>
|
||||
|
||||
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);
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user