ia64/xen-unstable

changeset 1357:29e2b28797f0

bitkeeper revision 1.894 (40a0e224yVjcoBy1sCnhKzymuscpoQ)

Add "show_traceX" function to Xen that will print a call trace from the
current stack pointer -- useful if you want to print out a debug message
to show how you got somewhere without calling BUG();
author iap10@labyrinth.cl.cam.ac.uk
date Tue May 11 14:24:36 2004 +0000 (2004-05-11)
parents 7f08b3170e20
children ef16fc03abbf
files xen/arch/i386/traps.c
line diff
     1.1 --- a/xen/arch/i386/traps.c	Tue May 11 14:21:47 2004 +0000
     1.2 +++ b/xen/arch/i386/traps.c	Tue May 11 14:24:36 2004 +0000
     1.3 @@ -107,6 +107,7 @@ static inline int kernel_text_address(un
     1.4  
     1.5  }
     1.6  
     1.7 +
     1.8  void show_trace(unsigned long * stack)
     1.9  {
    1.10      int i;
    1.11 @@ -126,6 +127,13 @@ void show_trace(unsigned long * stack)
    1.12      printk("\n");
    1.13  }
    1.14  
    1.15 +void show_traceX(void)
    1.16 +{
    1.17 +    unsigned long *addr;
    1.18 +    __asm__ __volatile__ ("movl %%esp,%0" : "=r" (addr) : );
    1.19 +    show_trace(addr);
    1.20 +}
    1.21 +
    1.22  void show_stack(unsigned long *esp)
    1.23  {
    1.24      unsigned long *stack;
    1.25 @@ -172,6 +180,7 @@ void show_registers(struct pt_regs *regs
    1.26             regs->xfs & 0xffff, regs->xgs & 0xffff, ss);
    1.27  
    1.28      show_stack(&regs->esp);
    1.29 +    show_trace(&regs->esp);
    1.30  }	
    1.31  
    1.32  
    1.33 @@ -322,6 +331,8 @@ asmlinkage void do_page_fault(struct pt_
    1.34  
    1.35      __asm__ __volatile__ ("movl %%cr2,%0" : "=r" (addr) : );
    1.36  
    1.37 +//    __sti(); // XXXX This may not be safe??? LDT issues???
    1.38 +
    1.39      perfc_incrc(page_faults);
    1.40  
    1.41      if ( unlikely(addr >= LDT_VIRT_START) && 
    1.42 @@ -339,7 +350,7 @@ asmlinkage void do_page_fault(struct pt_
    1.43  
    1.44      if ( unlikely(p->mm.shadow_mode) && 
    1.45           (addr < PAGE_OFFSET) && shadow_fault(addr, error_code) )
    1.46 -	return; /* Return TRUE if fault was handled. */
    1.47 +	return; /* Returns TRUE if fault was handled. */
    1.48  
    1.49      if ( unlikely(!(regs->xcs & 3)) )
    1.50          goto fault_in_hypervisor;