[PATCH,RFC 2.6.14 07/15] x86_64: Add a notifier hook to the "no context" part of do_page_fault

Tom Rini
2005-11-10T16:42:31Z

This adds a call to notify_die() in the "no context" portion of
do_page_fault() as someone on the chain might care and want to do a fixup.

arch/x86_64/mm/fault.c | 4 ++++
include/asm-x86_64/kdebug.h | 1 +
2 files changed, 5 insertions(+)

Index: linux-2.6.14/arch/x86_64/mm/fault.c
===================================================================
--- linux-2.6.14.orig/arch/x86_64/mm/fault.c
+++ linux-2.6.14/arch/x86_64/mm/fault.c
@@ -518,6 +518,10 @@ no_context:
if (is_errata93(regs, address))
return;

+ if (notify_die(DIE_PAGE_FAULT_NO_CONTEXT, "no context", regs,
+ error_code, 14, SIGSEGV) == NOTIFY_STOP)
+ return;
+
/*
* Oops. The kernel tried to access some bad page. We'll have to
* terminate things with extreme prejudice.
Index: linux-2.6.14/include/asm-x86_64/kdebug.h
===================================================================
--- linux-2.6.14.orig/include/asm-x86_64/kdebug.h
+++ linux-2.6.14/include/asm-x86_64/kdebug.h
@@ -33,6 +33,7 @@ enum die_val {
DIE_CALL,
DIE_NMI_IPI,
DIE_PAGE_FAULT,
+ DIE_PAGE_FAULT_NO_CONTEXT,
};

static inline int notify_die(enum die_val val,char *str,struct pt_regs *regs,long err,int trap, int sig)

--
Tom