[PATCH] i386: make fault notifier unconditional and export it
It's needed for external debuggers and overhead is very small. Also make the actual notifier chain they use static Cc: jbeulich@novell.com Signed-off-by: Andi Kleen <ak@suse.de>
This commit is contained in:
@@ -30,18 +30,20 @@
|
|||||||
|
|
||||||
extern void die(const char *,struct pt_regs *,long);
|
extern void die(const char *,struct pt_regs *,long);
|
||||||
|
|
||||||
#ifdef CONFIG_KPROBES
|
static ATOMIC_NOTIFIER_HEAD(notify_page_fault_chain);
|
||||||
ATOMIC_NOTIFIER_HEAD(notify_page_fault_chain);
|
|
||||||
int register_page_fault_notifier(struct notifier_block *nb)
|
int register_page_fault_notifier(struct notifier_block *nb)
|
||||||
{
|
{
|
||||||
vmalloc_sync_all();
|
vmalloc_sync_all();
|
||||||
return atomic_notifier_chain_register(¬ify_page_fault_chain, nb);
|
return atomic_notifier_chain_register(¬ify_page_fault_chain, nb);
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(register_page_fault_notifier);
|
||||||
|
|
||||||
int unregister_page_fault_notifier(struct notifier_block *nb)
|
int unregister_page_fault_notifier(struct notifier_block *nb)
|
||||||
{
|
{
|
||||||
return atomic_notifier_chain_unregister(¬ify_page_fault_chain, nb);
|
return atomic_notifier_chain_unregister(¬ify_page_fault_chain, nb);
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(unregister_page_fault_notifier);
|
||||||
|
|
||||||
static inline int notify_page_fault(enum die_val val, const char *str,
|
static inline int notify_page_fault(enum die_val val, const char *str,
|
||||||
struct pt_regs *regs, long err, int trap, int sig)
|
struct pt_regs *regs, long err, int trap, int sig)
|
||||||
@@ -55,14 +57,6 @@ static inline int notify_page_fault(enum die_val val, const char *str,
|
|||||||
};
|
};
|
||||||
return atomic_notifier_call_chain(¬ify_page_fault_chain, val, &args);
|
return atomic_notifier_call_chain(¬ify_page_fault_chain, val, &args);
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
static inline int notify_page_fault(enum die_val val, const char *str,
|
|
||||||
struct pt_regs *regs, long err, int trap, int sig)
|
|
||||||
{
|
|
||||||
return NOTIFY_DONE;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Unlock any spinlocks which will prevent us from getting the
|
* Unlock any spinlocks which will prevent us from getting the
|
||||||
|
Reference in New Issue
Block a user