Skip to contentSkip to conversation

x86_64: Add notify_die() to another spot in do_page_fault()

PATCH In review Tom Rini 2 participants 4 messages Sep 8, 2005 – Sep 9, 2005

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 x86_64: Add notify_die() to another spot in do_page_fault()

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.

---

 linux-2.6.13-trini/arch/x86_64/mm/fault.c |    4 ++++
 1 files changed, 4 insertions(+)
arch/x86_64/mm/fault.c renamed from arch/x86_64/mm/fault.c~x86_64-no_context_hook +4 -0
diff -puN arch/x86_64/mm/fault.c~x86_64-no_context_hook arch/x86_64/mm/fault.c
@@ -514,6 +514,10 @@ no_context:
 	if (is_errata93(regs, address))
 		return; 
 
+	if (notify_die(DIE_PAGE_FAULT, "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.
Signature · 2 lines
Tom Rini
http://gate.crashing.org/~trini/
#1 lore raw
Quoted 14 lines · Tom Rini

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.

---

 linux-2.6.13-trini/arch/x86_64/mm/fault.c |    4 ++++
 1 files changed, 4 insertions(+)

diff -puN arch/x86_64/mm/fault.c~x86_64-no_context_hook arch/x86_64/mm/fault.c ---
linux-2.6.13/arch/x86_64/mm/fault.c~x86_64-no_context_hook 2005-09-01
12:00:43.000000000 -0700 +++
linux-2.6.13-trini/arch/x86_64/mm/fault.c 2005-09-01 12:00:43.000000000
-0700 @@ -514,6 +514,10 @@ no_context:

arch/x86_64/mm/fault.c no_context: · line 520

Quoted 7 lines
arch/x86_64/mm/fault.c renamed from arch/x86_64/mm/fault.c~x86_64-no_context_hook +4 -0
 	if (is_errata93(regs, address))
 		return;
 
+	if (notify_die(DIE_PAGE_FAULT, "no context", regs, error_code, 14,
+				SIGSEGV) == NOTIFY_STOP)
+		return;
+

But how would the chain users distingush this from the DIE_PAGE_FAULT reported at the beginning of the page fault handler? I don't see how it can work. If anything you would need a DIE_NO_CONTEXT or somesuch, no?

-Andi

author
#2 lore raw
Quoted 18 lines · Andi Kleen
Quoted 17 lines · Tom Rini

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.

---

 linux-2.6.13-trini/arch/x86_64/mm/fault.c |    4 ++++
 1 files changed, 4 insertions(+)

diff -puN arch/x86_64/mm/fault.c~x86_64-no_context_hook arch/x86_64/mm/fault.c ---
linux-2.6.13/arch/x86_64/mm/fault.c~x86_64-no_context_hook 2005-09-01
12:00:43.000000000 -0700 +++
linux-2.6.13-trini/arch/x86_64/mm/fault.c 2005-09-01 12:00:43.000000000
-0700 @@ -514,6 +514,10 @@ no_context:

arch/x86_64/mm/fault.c renamed from arch/x86_64/mm/fault.c~x86_64-no_context_hook +0 -0
 	if (is_errata93(regs, address))
 		return;
Quoted 8 lines

arch/x86_64/mm/fault.c no_context: · line 520

Quoted 4 lines
arch/x86_64/mm/fault.c renamed from arch/x86_64/mm/fault.c~x86_64-no_context_hook +4 -0
+	if (notify_die(DIE_PAGE_FAULT, "no context", regs, error_code, 14,
+				SIGSEGV) == NOTIFY_STOP)
+		return;
+

But how would the chain users distingush this from the DIE_PAGE_FAULT reported at the beginning of the page fault handler? I don't see how it can work. If anything you would need a DIE_NO_CONTEXT or somesuch, no?

"no context" is passed to the functions as well, and in KGDB we strcmp on that.

Signature · 2 lines
Tom Rini
http://gate.crashing.org/~trini/
#3 lore raw
Quoted 2 lines · Tom Rini

"no context" is passed to the functions as well, and in KGDB we strcmp on that.

Please define a new DIE code instead.

-Andi