ia64/xen-unstable

changeset 16879:1a2f557448cf

x86: make show_page_walk() more robust.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jan 24 18:11:44 2008 +0000 (2008-01-24)
parents 7a2824f99a28
children 78a29cf8476b
files xen/arch/x86/x86_32/traps.c xen/arch/x86/x86_64/traps.c
line diff
     1.1 --- a/xen/arch/x86/x86_32/traps.c	Thu Jan 24 18:09:26 2008 +0000
     1.2 +++ b/xen/arch/x86/x86_32/traps.c	Thu Jan 24 18:11:44 2008 +0000
     1.3 @@ -132,7 +132,7 @@ void show_page_walk(unsigned long addr)
     1.4      l3t += (cr3 & 0xFE0UL) >> 3;
     1.5      l3e = l3t[l3_table_offset(addr)];
     1.6      mfn = l3e_get_pfn(l3e);
     1.7 -    pfn = get_gpfn_from_mfn(mfn);
     1.8 +    pfn = mfn_valid(mfn) ? get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
     1.9      printk(" L3[0x%03lx] = %"PRIpte" %08lx\n",
    1.10             l3_table_offset(addr), l3e_get_intpte(l3e), pfn);
    1.11      unmap_domain_page(l3t);
    1.12 @@ -143,7 +143,7 @@ void show_page_walk(unsigned long addr)
    1.13      l2t = map_domain_page(mfn);
    1.14      l2e = l2t[l2_table_offset(addr)];
    1.15      mfn = l2e_get_pfn(l2e);
    1.16 -    pfn = get_gpfn_from_mfn(mfn);
    1.17 +    pfn = mfn_valid(mfn) ? get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
    1.18      printk(" L2[0x%03lx] = %"PRIpte" %08lx %s\n",
    1.19             l2_table_offset(addr), l2e_get_intpte(l2e), pfn,
    1.20             (l2e_get_flags(l2e) & _PAGE_PSE) ? "(PSE)" : "");
    1.21 @@ -155,7 +155,7 @@ void show_page_walk(unsigned long addr)
    1.22      l1t = map_domain_page(mfn);
    1.23      l1e = l1t[l1_table_offset(addr)];
    1.24      mfn = l1e_get_pfn(l1e);
    1.25 -    pfn = get_gpfn_from_mfn(mfn);
    1.26 +    pfn = mfn_valid(mfn) ? get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
    1.27      printk(" L1[0x%03lx] = %"PRIpte" %08lx\n",
    1.28             l1_table_offset(addr), l1e_get_intpte(l1e), pfn);
    1.29      unmap_domain_page(l1t);
     2.1 --- a/xen/arch/x86/x86_64/traps.c	Thu Jan 24 18:09:26 2008 +0000
     2.2 +++ b/xen/arch/x86/x86_64/traps.c	Thu Jan 24 18:11:44 2008 +0000
     2.3 @@ -136,7 +136,7 @@ void show_page_walk(unsigned long addr)
     2.4      l4t = mfn_to_virt(mfn);
     2.5      l4e = l4t[l4_table_offset(addr)];
     2.6      mfn = l4e_get_pfn(l4e);
     2.7 -    pfn = get_gpfn_from_mfn(mfn);
     2.8 +    pfn = mfn_valid(mfn) ? get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
     2.9      printk(" L4[0x%03lx] = %"PRIpte" %016lx\n",
    2.10             l4_table_offset(addr), l4e_get_intpte(l4e), pfn);
    2.11      if ( !(l4e_get_flags(l4e) & _PAGE_PRESENT) )
    2.12 @@ -145,7 +145,7 @@ void show_page_walk(unsigned long addr)
    2.13      l3t = mfn_to_virt(mfn);
    2.14      l3e = l3t[l3_table_offset(addr)];
    2.15      mfn = l3e_get_pfn(l3e);
    2.16 -    pfn = get_gpfn_from_mfn(mfn);
    2.17 +    pfn = mfn_valid(mfn) ? get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
    2.18      printk(" L3[0x%03lx] = %"PRIpte" %016lx\n",
    2.19             l3_table_offset(addr), l3e_get_intpte(l3e), pfn);
    2.20      if ( !(l3e_get_flags(l3e) & _PAGE_PRESENT) )
    2.21 @@ -154,7 +154,7 @@ void show_page_walk(unsigned long addr)
    2.22      l2t = mfn_to_virt(mfn);
    2.23      l2e = l2t[l2_table_offset(addr)];
    2.24      mfn = l2e_get_pfn(l2e);
    2.25 -    pfn = get_gpfn_from_mfn(mfn);
    2.26 +    pfn = mfn_valid(mfn) ? get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
    2.27      printk(" L2[0x%03lx] = %"PRIpte" %016lx %s\n",
    2.28             l2_table_offset(addr), l2e_get_intpte(l2e), pfn,
    2.29             (l2e_get_flags(l2e) & _PAGE_PSE) ? "(PSE)" : "");
    2.30 @@ -165,7 +165,7 @@ void show_page_walk(unsigned long addr)
    2.31      l1t = mfn_to_virt(mfn);
    2.32      l1e = l1t[l1_table_offset(addr)];
    2.33      mfn = l1e_get_pfn(l1e);
    2.34 -    pfn = get_gpfn_from_mfn(mfn);
    2.35 +    pfn = mfn_valid(mfn) ? get_gpfn_from_mfn(mfn) : INVALID_M2P_ENTRY;
    2.36      printk(" L1[0x%03lx] = %"PRIpte" %016lx\n",
    2.37             l1_table_offset(addr), l1e_get_intpte(l1e), pfn);
    2.38  }