Skip to contentSkip to conversation

x86: Unify page fault oops printing

PATCH Applied Harvey Harrison 2 participants 2 messages Jan 21, 2008 – Jan 22, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 3/3 x86: Unify page fault oops printing

This changes the oops dumping format for page faults to be similar between X86_32 and 64.

This is the first user of printk_address on X86_32.

---
Ingo, this patch has behavior changes that will need discussion

 arch/x86/mm/fault_32.c |   12 ++++++------
 arch/x86/mm/fault_64.c |    9 ++++++---
 2 files changed, 12 insertions(+), 9 deletions(-)
arch/x86/mm/fault_32.c +6 -6
index fda3997..28ea3d3 100644
@@ -340,15 +340,15 @@ static void show_fault_oops(struct pt_regs *regs, unsigned long error_code,
 				"(uid: %d)\n", current->uid);
 	}
 #endif
+	printk(KERN_ALERT "BUG: unable to handle kernel ");
 	if (address < PAGE_SIZE)
-		printk(KERN_ALERT "BUG: unable to handle kernel NULL "
-				"pointer dereference");
+		printk(KERN_CONT "NULL pointer dereference");
 	else
-		printk(KERN_ALERT "BUG: unable to handle kernel paging"
-				" request");
-	printk(" at virtual address %08lx\n", address);
-	printk(KERN_ALERT "printing ip: %08lx ", regs->ip);
+		printk(KERN_CONT "paging request");
+	printk(KERN_CONT " at %08lx\n", address);
 
+	printk(KERN_ALERT "IP:");
+	printk_address(regs->ip, 1);
 	dump_pagetable(address);
 }
 
arch/x86/mm/fault_64.c +6 -3
index 1897704..e12c34b 100644
@@ -296,11 +296,14 @@ static int is_f00f_bug(struct pt_regs *regs, unsigned long address)
 static void show_fault_oops(struct pt_regs *regs, unsigned long error_code,
 			    unsigned long address)
 {
+	printk(KERN_ALERT "BUG: unable to handle kernel ");
 	if (address < PAGE_SIZE)
-		printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference");
+		printk(KERN_CONT "NULL pointer dereference");
 	else
-		printk(KERN_ALERT "Unable to handle kernel paging request");
-	printk(" at %016lx RIP: \n" KERN_ALERT, address);
+		printk(KERN_CONT "paging request");
+	printk(KERN_CONT " at %016lx\n", address);
+
+	printk(KERN_ALERT "IP:");
 	printk_address(regs->ip, 1);
 	dump_pagetable(address);
 }
Signature · 1 line
1.5.4.rc3.1118.gf6754c
#1 lore raw
Quoted 4 lines · Harvey Harrison

This changes the oops dumping format for page faults to be similar between X86_32 and 64.

This is the first user of printk_address on X86_32.

could you please send an actual before/after dump, so that we can see the behavioral changes?

Ingo