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-devel

[Xen-devel] [PATCH] x86: also show event upcall mask when dumping guest

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] x86: also show event upcall mask when dumping guest state
From: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Date: Fri, 08 Aug 2008 13:50:31 +0100
Delivery-date: Fri, 08 Aug 2008 05:50:10 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

Index: 2008-08-06/xen/arch/x86/x86_32/traps.c
===================================================================
--- 2008-08-06.orig/xen/arch/x86/x86_32/traps.c 2008-08-06 14:38:31.000000000 
+0200
+++ 2008-08-06/xen/arch/x86/x86_32/traps.c      2008-08-07 11:19:36.000000000 
+0200
@@ -33,13 +33,18 @@ static void print_xen_info(void)
 }
 
 static void _show_registers(const struct cpu_user_regs *regs,
-                            unsigned long crs[8], int guest_mode,
-                            const char *context)
+                            unsigned long crs[8], const char *context,
+                            const struct vcpu_info *vcpu_info)
 {
     printk("EIP:    %04x:[<%08x>]", regs->cs, regs->eip);
-    if ( !guest_mode )
-        print_symbol(" %s", regs->eip);
-    printk("\nEFLAGS: %08x   CONTEXT: %s\n", regs->eflags, context);
+    if ( !context )
+    {
+        print_symbol(" %s\n", regs->eip);
+        printk("EFLAGS: %08x   CONTEXT: hypervisor\n", regs->eflags);
+    }
+    else
+        printk("\nEFLAGS: %08x   EM=%d   CONTEXT: %s\n",
+               regs->eflags, vcpu_info->evtchn_upcall_mask, context);
     printk("eax: %08x   ebx: %08x   ecx: %08x   edx: %08x\n",
            regs->eax, regs->ebx, regs->ecx, regs->edx);
     printk("esi: %08x   edi: %08x   ebp: %08x   esp: %08x\n",
@@ -84,7 +89,7 @@ void show_registers(struct cpu_user_regs
     {
         if ( !guest_mode(regs) )
         {
-            context = "hypervisor";
+            context = NULL;
             fault_regs.esp = (unsigned long)&regs->esp;
             fault_regs.ss = read_segment_register(ss);
             fault_regs.ds = read_segment_register(ds);
@@ -106,7 +111,7 @@ void show_registers(struct cpu_user_regs
 
     print_xen_info();
     printk("CPU:    %d\n", smp_processor_id());
-    _show_registers(&fault_regs, fault_crs, guest_mode(regs), context);
+    _show_registers(&fault_regs, fault_crs, context, v->vcpu_info);
 
     if ( this_cpu(ler_msr) && !guest_mode(regs) )
     {
@@ -130,7 +135,8 @@ void vcpu_show_registers(const struct vc
     crs[3] = pagetable_get_paddr(v->arch.guest_table);
     crs[4] = v->arch.guest_context.ctrlreg[4];
 
-    _show_registers(&v->arch.guest_context.user_regs, crs, 1, "guest");
+    _show_registers(&v->arch.guest_context.user_regs, crs, "guest",
+                    v->vcpu_info);
 }
 
 void show_page_walk(unsigned long addr)
Index: 2008-08-06/xen/arch/x86/x86_64/traps.c
===================================================================
--- 2008-08-06.orig/xen/arch/x86/x86_64/traps.c 2008-08-06 14:38:31.000000000 
+0200
+++ 2008-08-06/xen/arch/x86/x86_64/traps.c      2008-08-07 11:18:47.000000000 
+0200
@@ -41,13 +41,18 @@ static void print_xen_info(void)
 }
 
 static void _show_registers(const struct cpu_user_regs *regs,
-                            unsigned long crs[8], int guest_mode,
-                            const char *context)
+                            unsigned long crs[8], const char *context,
+                            const struct vcpu *v)
 {
     printk("RIP:    %04x:[<%016lx>]", regs->cs, regs->rip);
-    if ( !guest_mode )
-        print_symbol(" %s", regs->rip);
-    printk("\nRFLAGS: %016lx   CONTEXT: %s\n", regs->rflags, context);
+    if ( !context )
+    {
+        print_symbol(" %s\n", regs->rip);
+        printk("RFLAGS: %016lx   CONTEXT: hypervisor\n", regs->rflags);
+    }
+    else
+        printk("\nRFLAGS: %016lx   EM=%d   CONTEXT: %s\n",
+               regs->rflags, vcpu_info(v, evtchn_upcall_mask), context);
     printk("rax: %016lx   rbx: %016lx   rcx: %016lx\n",
            regs->rax, regs->rbx, regs->rcx);
     printk("rdx: %016lx   rsi: %016lx   rdi: %016lx\n",
@@ -104,7 +109,7 @@ void show_registers(struct cpu_user_regs
         }
         else
         {
-            context = "hypervisor";
+            context = NULL;
             fault_crs[2] = read_cr2();
         }
 
@@ -119,7 +124,7 @@ void show_registers(struct cpu_user_regs
 
     print_xen_info();
     printk("CPU:    %d\n", smp_processor_id());
-    _show_registers(&fault_regs, fault_crs, guest_mode(regs), context);
+    _show_registers(&fault_regs, fault_crs, context, v);
 
     if ( this_cpu(ler_msr) && !guest_mode(regs) )
     {
@@ -146,7 +151,7 @@ void vcpu_show_registers(const struct vc
                                  v->arch.guest_table_user);
     crs[4] = v->arch.guest_context.ctrlreg[4];
 
-    _show_registers(regs, crs, 1, "guest");
+    _show_registers(regs, crs, "guest", v);
 }
 
 void show_page_walk(unsigned long addr)



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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] x86: also show event upcall mask when dumping guest state, Jan Beulich <=