]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/patches/suse-2.6.27.31/patches.xen/xen-x86_64-dump-user-pgt
Move xen patchset to new version's subdir.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.xen / xen-x86_64-dump-user-pgt
diff --git a/src/patches/suse-2.6.27.31/patches.xen/xen-x86_64-dump-user-pgt b/src/patches/suse-2.6.27.31/patches.xen/xen-x86_64-dump-user-pgt
new file mode 100644 (file)
index 0000000..5956139
--- /dev/null
@@ -0,0 +1,48 @@
+From: jbeulich@novell.com
+Subject: dump the correct page tables for user mode faults
+Patch-mainline: obsolete
+
+Index: head-2008-11-10/arch/x86/mm/fault-xen.c
+===================================================================
+--- head-2008-11-10.orig/arch/x86/mm/fault-xen.c       2008-11-17 11:33:51.000000000 +0100
++++ head-2008-11-10/arch/x86/mm/fault-xen.c    2008-11-17 11:38:21.000000000 +0100
+@@ -189,9 +189,11 @@ static int bad_address(void *p)
+       unsigned long dummy;
+       return probe_kernel_address((unsigned long *)p, dummy);
+ }
++#else
++#define dump_pagetable(addr, krnl) dump_pagetable(addr)
+ #endif
+-static void dump_pagetable(unsigned long address)
++static void dump_pagetable(unsigned long address, bool kernel)
+ {
+ #ifdef CONFIG_X86_32
+       __typeof__(pte_val(__pte(0))) page;
+@@ -239,6 +241,8 @@ static void dump_pagetable(unsigned long
+       pgd = (pgd_t *)read_cr3();
+       pgd = __va((unsigned long)pgd & PHYSICAL_PAGE_MASK);
++      if (!kernel)
++              pgd = __user_pgd(pgd);
+       pgd += pgd_index(address);
+       if (bad_address(pgd)) goto bad;
+       printk("PGD %lx ", pgd_val(*pgd));
+@@ -419,7 +423,7 @@ static void show_fault_oops(struct pt_re
+       printk(KERN_CONT " at %p\n", (void *) address);
+       printk(KERN_ALERT "IP:");
+       printk_address(regs->ip, 1);
+-      dump_pagetable(address);
++      dump_pagetable(address, !(error_code & PF_USER));
+ }
+ #ifdef CONFIG_X86_64
+@@ -431,7 +435,7 @@ static noinline void pgtable_bad(unsigne
+       printk(KERN_ALERT "%s: Corrupted page table at address %lx\n",
+              current->comm, address);
+-      dump_pagetable(address);
++      dump_pagetable(address, !(error_code & PF_USER));
+       tsk = current;
+       tsk->thread.cr2 = address;
+       tsk->thread.trap_no = 14;