lkml.org 
[lkml]   [2001]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch] print-64gb-oopses-2.4.2-J2

the attached patch (against 2.4.3) makes pagetable-printing
PAE-compatible, handling the nonexistent pagetable case too.

Ingo
--- linux/arch/i386/mm/fault.c.orig Tue Apr 3 13:58:58 2001
+++ linux/arch/i386/mm/fault.c Tue Apr 3 13:59:22 2001
@@ -90,6 +90,33 @@
spin_lock_init(&timerlist_lock);
}

+static void print_pagetable_entries (pgd_t *pgdir, unsigned long address)
+{
+ pgd_t *pgd;
+ pmd_t *pmd;
+ pte_t *pte;
+
+ pgd = pgdir + __pgd_offset(address);
+ printk("pgd entry %p: %016Lx\n", pgd, (long long)pgd_val(*pgd));
+
+ if (!pgd_present(*pgd)) {
+ printk("... pgd not present!\n");
+ return;
+ }
+ pmd = pmd_offset(pgd, address);
+ printk("pmd entry %p: %016Lx\n", pmd, (long long)pmd_val(*pmd));
+
+ if (!pmd_present(*pmd)) {
+ printk("... pmd not present!\n");
+ return;
+ }
+ pte = pte_offset(pmd, address);
+ printk("pte entry %p: %016Lx\n", pte, (long long)pte_val(*pte));
+
+ if (!pte_present(*pte))
+ printk("... pte not present!\n");
+}
+
asmlinkage void do_invalid_op(struct pt_regs *, unsigned long);
extern unsigned long idt;

@@ -274,14 +301,7 @@
printk(" printing eip:\n");
printk("%08lx\n", regs->eip);
asm("movl %%cr3,%0":"=r" (page));
- page = ((unsigned long *) __va(page))[address >> 22];
- printk(KERN_ALERT "*pde = %08lx\n", page);
- if (page & 1) {
- page &= PAGE_MASK;
- address &= 0x003ff000;
- page = ((unsigned long *) __va(page))[address >> PAGE_SHIFT];
- printk(KERN_ALERT "*pte = %08lx\n", page);
- }
+ print_pagetable_entries((pgd_t *)__va(page), address);
die("Oops", regs, error_code);
do_exit(SIGKILL);
\
 
 \ /
  Last update: 2005-03-22 13:22    [W:0.057 / U:0.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site