WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] merge?

# HG changeset patch
# User cl349@xxxxxxxxxxxxxxxxxxxx
# Node ID bd951d23d713857e1bf562d2e6ec30d72a0cec68
# Parent  4d018790ff8a17e6fcfce4e274fd4b9fac0ab568
# Parent  69bf4490062faf91521565b5bda9662af4e30e57
merge?

diff -r 4d018790ff8a -r bd951d23d713 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c      Tue Sep 13 10:13:52 2005
+++ b/xen/arch/x86/traps.c      Tue Sep 13 10:14:20 2005
@@ -106,7 +106,7 @@
 #define ESP_BEFORE_EXCEPTION(regs) ((unsigned long *)&regs->esp)
 #else
 #define stack_words_per_line 4
-#define ESP_BEFORE_EXCEPTION(regs) ((unsigned long *)regs->esp)
+#define ESP_BEFORE_EXCEPTION(regs) ((unsigned long *)regs->rsp)
 #endif
 
 int is_kernel_text(unsigned long addr)
@@ -238,7 +238,7 @@
     unsigned long *stack = ESP_BEFORE_EXCEPTION(regs), addr;
     int i;
 
-    if ( GUEST_MODE(regs) )
+    if ( GUEST_CONTEXT(current, regs) )
         return show_guest_stack(regs);
 
     printk("Xen stack trace from "__OP"sp=%p:\n   ", stack);
diff -r 4d018790ff8a -r bd951d23d713 xen/arch/x86/x86_64/traps.c
--- a/xen/arch/x86/x86_64/traps.c       Tue Sep 13 10:13:52 2005
+++ b/xen/arch/x86/x86_64/traps.c       Tue Sep 13 10:14:20 2005
@@ -12,25 +12,51 @@
 #include <asm/current.h>
 #include <asm/flushtlb.h>
 #include <asm/msr.h>
+#include <asm/vmx.h>
 
 void show_registers(struct cpu_user_regs *regs)
 {
-    printk("CPU:    %d\nRIP:    %04x:[<%016lx>]",
-           smp_processor_id(), 0xffff & regs->cs, regs->rip);
+    unsigned long rip, rsp, rflags, cs, cr0, cr3;
+    const char *context;
+
+    if ( VMX_DOMAIN(current) && (regs->eflags == 0) )
+    {
+        __vmread(GUEST_RIP, &rip);
+        __vmread(GUEST_RSP, &rsp);
+        __vmread(GUEST_RFLAGS, &rflags);
+        __vmread(GUEST_CS_SELECTOR, &cs);
+        __vmread(CR0_READ_SHADOW, &cr0);
+        __vmread(GUEST_CR3, &cr3);
+        context = "vmx guest";
+    }
+    else
+    {
+        rip     = regs->rip;
+        rflags  = regs->rflags;
+        cr0     = read_cr0();
+        cr3     = read_cr3();
+        rsp     = regs->rsp;
+        cs      = regs->cs & 0xffff;
+        context = GUEST_MODE(regs) ? "guest" : "hypervisor";
+    }
+
+    printk("CPU:    %d\nRIP:    %04lx:[<%016lx>]",
+           smp_processor_id(), cs, rip);
     if ( !GUEST_MODE(regs) )
-        print_symbol(" %s", regs->rip);
-    printk("\nRFLAGS: %016lx\n", regs->eflags);
+        print_symbol(" %s", rip);
+    printk("\nRFLAGS: %016lx   CONTEXT: %s\n", rflags, context);
     printk("rax: %016lx   rbx: %016lx   rcx: %016lx\n",
            regs->rax, regs->rbx, regs->rcx);
     printk("rdx: %016lx   rsi: %016lx   rdi: %016lx\n",
            regs->rdx, regs->rsi, regs->rdi);
     printk("rbp: %016lx   rsp: %016lx   r8:  %016lx\n",
-           regs->rbp, regs->rsp, regs->r8);
+           regs->rbp, rsp, regs->r8);
     printk("r9:  %016lx   r10: %016lx   r11: %016lx\n",
            regs->r9,  regs->r10, regs->r11);
     printk("r12: %016lx   r13: %016lx   r14: %016lx\n",
            regs->r12, regs->r13, regs->r14);
-    printk("r15: %016lx\n", regs->r15);
+    printk("r15: %016lx   cr0: %016lx   cr3: %016lx\n",
+           regs->r15, cr0, cr3);
 
     show_stack(regs);
 }
@@ -194,3 +220,13 @@
 
     return 0;
 }
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>