[PATCH 11/21] KGDB: This adds a call to notify_die()

From: Jason Wessel
Date: Mon Oct 15 2007 - 14:39:59 EST


Signed-off-by: Jason Wessel <jason.wessel@xxxxxxxxxxxxx>
x86_64-no_context_hook.patch

From: Jason Wessel <jason.wessel@xxxxxxxxxxxxx>
CC: ak@xxxxxxx
Subject: [PATCH] This adds a call to notify_die()

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

Signed-off-by: Tom Rini <trini@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Jason Wessel <jason.wessel@xxxxxxxxxxxxx>
---
arch/x86/mm/fault_64.c | 4 ++++
include/asm-x86/kdebug_64.h | 1 +
2 files changed, 5 insertions(+)

--- a/arch/x86/mm/fault_64.c
+++ b/arch/x86/mm/fault_64.c
@@ -531,6 +531,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.
--- a/include/asm-x86/kdebug_64.h
+++ b/include/asm-x86/kdebug_64.h
@@ -23,6 +23,7 @@ enum die_val {
DIE_CALL,
DIE_NMI_IPI,
DIE_PAGE_FAULT,
+ DIE_PAGE_FAULT_NO_CONTEXT,
};

extern void printk_address(unsigned long address);