ia64/xen-unstable

changeset 6349:017a3a97ace2

Improve show_page_walk() debugging in Xen, to print
arbitrary page walks (not just walks of Xen mappings).

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Tue Aug 23 17:28:10 2005 +0000 (2005-08-23)
parents 648c366d588b
children f80278e5e440
files xen/arch/x86/x86_32/traps.c
line diff
     1.1 --- a/xen/arch/x86/x86_32/traps.c	Tue Aug 23 13:53:04 2005 +0000
     1.2 +++ b/xen/arch/x86/x86_32/traps.c	Tue Aug 23 17:28:10 2005 +0000
     1.3 @@ -1,5 +1,6 @@
     1.4  
     1.5  #include <xen/config.h>
     1.6 +#include <xen/domain_page.h>
     1.7  #include <xen/init.h>
     1.8  #include <xen/sched.h>
     1.9  #include <xen/lib.h>
    1.10 @@ -86,24 +87,33 @@ void show_registers(struct cpu_user_regs
    1.11  
    1.12  void show_page_walk(unsigned long addr)
    1.13  {
    1.14 -    l2_pgentry_t pmd;
    1.15 -    l1_pgentry_t *pte;
    1.16 -
    1.17 -    if ( addr < PAGE_OFFSET )
    1.18 -        return;
    1.19 +    unsigned long pfn = read_cr3() >> PAGE_SHIFT;
    1.20 +    intpte_t *ptab, ent;
    1.21  
    1.22      printk("Pagetable walk from %08lx:\n", addr);
    1.23 -    
    1.24 -    pmd = idle_pg_table_l2[l2_linear_offset(addr)];
    1.25 -    printk(" L2 = %"PRIpte" %s\n", l2e_get_intpte(pmd),
    1.26 -           (l2e_get_flags(pmd) & _PAGE_PSE) ? "(2/4MB)" : "");
    1.27 -    if ( !(l2e_get_flags(pmd) & _PAGE_PRESENT) ||
    1.28 -         (l2e_get_flags(pmd) & _PAGE_PSE) )
    1.29 +
    1.30 +#ifdef CONFIG_X86_PAE
    1.31 +    ptab = map_domain_page(pfn);
    1.32 +    ent = ptab[l3_table_offset(addr)];
    1.33 +    printk(" L3 = %"PRIpte"\n", ent);
    1.34 +    unmap_domain_page(ptab);
    1.35 +    if ( !(ent & _PAGE_PRESENT) )
    1.36          return;
    1.37 +    pfn = ent >> PAGE_SHIFT;
    1.38 +#endif
    1.39  
    1.40 -    pte  = __va(l2e_get_paddr(pmd));
    1.41 -    pte += l1_table_offset(addr);
    1.42 -    printk("  L1 = %"PRIpte"\n", l1e_get_intpte(*pte));
    1.43 +    ptab = map_domain_page(pfn);
    1.44 +    ent = ptab[l2_table_offset(addr)];
    1.45 +    printk("  L2 = %"PRIpte" %s\n", ent, (ent & _PAGE_PSE) ? "(PSE)" : "");
    1.46 +    unmap_domain_page(ptab);
    1.47 +    if ( !(ent & _PAGE_PRESENT) || (ent & _PAGE_PSE) )
    1.48 +        return;
    1.49 +    pfn = ent >> PAGE_SHIFT;
    1.50 +
    1.51 +    ptab = map_domain_page(ent >> PAGE_SHIFT);
    1.52 +    ent = ptab[l2_table_offset(addr)];
    1.53 +    printk("   L1 = %"PRIpte"\n", ent);
    1.54 +    unmap_domain_page(ptab);
    1.55  }
    1.56  
    1.57  #define DOUBLEFAULT_STACK_SIZE 1024