ia64/xen-unstable

changeset 16887:923f2f736507

x86: Clarify early_page_fault() handler intent, and improve debug tracing.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Jan 25 13:42:36 2008 +0000 (2008-01-25)
parents 7f9646fcffe8
children 76601c290fa9
files xen/arch/x86/traps.c
line diff
     1.1 --- a/xen/arch/x86/traps.c	Fri Jan 25 13:29:51 2008 +0000
     1.2 +++ b/xen/arch/x86/traps.c	Fri Jan 25 13:42:36 2008 +0000
     1.3 @@ -1119,12 +1119,11 @@ asmlinkage void do_page_fault(struct cpu
     1.4  }
     1.5  
     1.6  /*
     1.7 - * Early handler to deal with spurious page faults. For example, consider a 
     1.8 - * routine that uses a mapping immediately after installing it (making it 
     1.9 - * present). The CPU may speculatively execute the memory access before 
    1.10 - * executing the PTE write. The instruction will then be marked to cause a 
    1.11 - * page fault when it is retired, despite the fact that the PTE is present and 
    1.12 - * correct at that point in time.
    1.13 + * Early #PF handler to print CR2, error code, and stack.
    1.14 + * 
    1.15 + * We also deal with spurious faults here, even though they should never happen
    1.16 + * during early boot (an issue was seen once, but was most likely a hardware 
    1.17 + * problem).
    1.18   */
    1.19  asmlinkage void do_early_page_fault(struct cpu_user_regs *regs)
    1.20  {
    1.21 @@ -1143,8 +1142,15 @@ asmlinkage void do_early_page_fault(stru
    1.22      }
    1.23  
    1.24      if ( stuck++ == 1000 )
    1.25 -        panic("Early fatal page fault at %04x:%p (cr2=%p, ec=%04x)\n", 
    1.26 -              regs->cs, _p(regs->eip), _p(cr2), regs->error_code);
    1.27 +    {
    1.28 +        unsigned long *stk = (unsigned long *)regs;
    1.29 +        printk("Early fatal page fault at %04x:%p (cr2=%p, ec=%04x)\n", 
    1.30 +               regs->cs, _p(regs->eip), _p(cr2), regs->error_code);
    1.31 +        printk("Stack dump: ");
    1.32 +        while ( ((long)stk & ((PAGE_SIZE - 1) & ~(BYTES_PER_LONG - 1))) != 0 )
    1.33 +            printk("%p ", _p(*stk++));
    1.34 +        for ( ; ; ) ;
    1.35 +    }
    1.36  }
    1.37  
    1.38  long do_fpu_taskswitch(int set)