[lkml]   [2007]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] Print error code in page faults
When a page faults comes from a kernel space, the printed summary
leaves us clueless about what kind of access was being tried (which
is encoded in the error_code variable).

Having it promply available may ease debugging in a bunch of

Signed-off-by: Glauber de Oliveira Costa <>

diff --git a/arch/x86_64/mm/fault.c b/arch/x86_64/mm/fault.c
index 6ada723..e65522e 100644
--- a/arch/x86_64/mm/fault.c
+++ b/arch/x86_64/mm/fault.c
@@ -539,7 +539,7 @@ no_context:
printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference");
printk(KERN_ALERT "Unable to handle kernel paging request");
- printk(" at %016lx RIP: \n" KERN_ALERT,address);
+ printk(" at %016lx (error=0x%02lx) RIP: \n" KERN_ALERT, error_code, address);
tsk->thread.cr2 = address;
 \ /
  Last update: 2007-02-24 06:31    [W:0.047 / U:8.132 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site