ia64/xen-unstable

changeset 10879:2d2ed4d9b1c1

[XEN] Some suspicion that we may enter an infinite
#PF loop due to broken spurious pagefault detection.
Beef up the tracing on that code path so we can catch
some useful info if it happens.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Mon Jul 31 10:40:21 2006 +0100 (2006-07-31)
parents c471b326b75e
children 7bb2e0be9cc2
files xen/arch/x86/traps.c
line diff
     1.1 --- a/xen/arch/x86/traps.c	Mon Jul 31 09:30:36 2006 +0000
     1.2 +++ b/xen/arch/x86/traps.c	Mon Jul 31 10:40:21 2006 +0100
     1.3 @@ -733,7 +733,10 @@ static int __spurious_page_fault(
     1.4           (l2e_get_flags(l2e) & disallowed_flags) )
     1.5          return 0;
     1.6      if ( l2e_get_flags(l2e) & _PAGE_PSE )
     1.7 -        return 1;
     1.8 +    {
     1.9 +        l1e = l1e_empty(); /* define before use in debug tracing */
    1.10 +        goto spurious;
    1.11 +    }
    1.12  
    1.13      l1t = map_domain_page(mfn);
    1.14      l1e = l1t[l1_table_offset(addr)];
    1.15 @@ -742,6 +745,22 @@ static int __spurious_page_fault(
    1.16      if ( !(l1e_get_flags(l1e) & required_flags) ||
    1.17           (l1e_get_flags(l1e) & disallowed_flags) )
    1.18          return 0;
    1.19 +
    1.20 + spurious:
    1.21 +    DPRINTK("Spurious fault in domain %u:%u at addr %lx, e/c %04x\n",
    1.22 +            current->domain->domain_id, current->vcpu_id,
    1.23 +            addr, regs->error_code);
    1.24 +#if CONFIG_PAGING_LEVELS >= 4
    1.25 +    DPRINTK(" l4e = %"PRIpte"\n", l4e_get_intpte(l4e));
    1.26 +#endif
    1.27 +#if CONFIG_PAGING_LEVELS >= 3
    1.28 +    DPRINTK(" l3e = %"PRIpte"\n", l3e_get_intpte(l3e));
    1.29 +#endif
    1.30 +    DPRINTK(" l2e = %"PRIpte"\n", l2e_get_intpte(l2e));
    1.31 +    DPRINTK(" l1e = %"PRIpte"\n", l1e_get_intpte(l1e));
    1.32 +#ifndef NDEBUG
    1.33 +    show_registers(regs);
    1.34 +#endif
    1.35      return 1;
    1.36  }
    1.37  
    1.38 @@ -839,11 +858,7 @@ asmlinkage int do_page_fault(struct cpu_
    1.39      if ( unlikely(!guest_mode(regs)) )
    1.40      {
    1.41          if ( spurious_page_fault(addr, regs) )
    1.42 -        {
    1.43 -            DPRINTK("Spurious fault in domain %u:%u at addr %lx\n",
    1.44 -                    current->domain->domain_id, current->vcpu_id, addr);
    1.45              return EXCRET_not_a_fault;
    1.46 -        }
    1.47  
    1.48          if ( likely((fixup = search_exception_table(regs->eip)) != 0) )
    1.49          {