bitkeeper revision 1.894 (40a0e224yVjcoBy1sCnhKzymuscpoQ)
authoriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>
Tue, 11 May 2004 14:24:36 +0000 (14:24 +0000)
committeriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>
Tue, 11 May 2004 14:24:36 +0000 (14:24 +0000)
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();

xen/arch/i386/traps.c

index f362faa05faf21d19229d554ece5216f313ac501..97c682a2af6fb6871b170144b2b5217748deab8e 100644 (file)
@@ -107,6 +107,7 @@ static inline int kernel_text_address(unsigned long addr)
 
 }
 
+
 void show_trace(unsigned long * stack)
 {
     int i;
@@ -126,6 +127,13 @@ void show_trace(unsigned long * stack)
     printk("\n");
 }
 
+void show_traceX(void)
+{
+    unsigned long *addr;
+    __asm__ __volatile__ ("movl %%esp,%0" : "=r" (addr) : );
+    show_trace(addr);
+}
+
 void show_stack(unsigned long *esp)
 {
     unsigned long *stack;
@@ -172,6 +180,7 @@ void show_registers(struct pt_regs *regs)
            regs->xfs & 0xffff, regs->xgs & 0xffff, ss);
 
     show_stack(&regs->esp);
+    show_trace(&regs->esp);
 }      
 
 
@@ -322,6 +331,8 @@ asmlinkage void do_page_fault(struct pt_regs *regs, long error_code)
 
     __asm__ __volatile__ ("movl %%cr2,%0" : "=r" (addr) : );
 
+//    __sti(); // XXXX This may not be safe??? LDT issues???
+
     perfc_incrc(page_faults);
 
     if ( unlikely(addr >= LDT_VIRT_START) && 
@@ -339,7 +350,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, long error_code)
 
     if ( unlikely(p->mm.shadow_mode) && 
          (addr < PAGE_OFFSET) && shadow_fault(addr, error_code) )
-       return; /* Return TRUE if fault was handled. */
+       return; /* Returns TRUE if fault was handled. */
 
     if ( unlikely(!(regs->xcs & 3)) )
         goto fault_in_hypervisor;