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] Clean up show_registers().

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Clean up show_registers().
From: BitKeeper Bot <riel@xxxxxxxxxxx>
Date: Mon, 06 Jun 2005 15:17:43 +0000
Delivery-date: Mon, 06 Jun 2005 16:00:51 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: Xen Development List <xen-devel@xxxxxxxxxxxxxxxxxxx>
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
ChangeSet 1.1685, 2005/06/06 16:17:43+01:00, kaf24@xxxxxxxxxxxxxxxxxxxx

        Clean up show_registers().
        Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>



 traps.c |   25 ++++++++-----------------
 1 files changed, 8 insertions(+), 17 deletions(-)


diff -Nru a/xen/arch/x86/x86_32/traps.c b/xen/arch/x86/x86_32/traps.c
--- a/xen/arch/x86/x86_32/traps.c       2005-06-06 12:01:46 -04:00
+++ b/xen/arch/x86/x86_32/traps.c       2005-06-06 12:01:46 -04:00
@@ -8,10 +8,7 @@
 #include <xen/irq.h>
 #include <asm/current.h>
 #include <asm/flushtlb.h>
-
-#ifdef CONFIG_VMX
 #include <asm/vmx.h>
-#endif
 
 /* All CPUs have their own IDT to allow int80 direct trap. */
 idt_entry_t *idt_tables[NR_CPUS] = { 0 };
@@ -19,10 +16,8 @@
 void show_registers(struct cpu_user_regs *regs)
 {
     unsigned long ss, ds, es, fs, gs, cs;
-    unsigned long eip, esp, eflags;
+    unsigned long eip, esp, eflags, cr0, cr3;
     const char *context;
-#ifdef CONFIG_VMX
-    unsigned long cr0, cr3;
 
     if ( VMX_DOMAIN(current) && (regs->eflags == 0) )
     {
@@ -40,10 +35,13 @@
         context = "vmx guest";
     }
     else
-#endif
     {
-        eip = regs->eip;
+        eip    = regs->eip;
         eflags = regs->eflags;
+        cr0    = read_cr0();
+        cr3    = read_cr3();
+
+        __asm__ ( "movl %%fs,%0 ; movl %%gs,%1" : "=r" (fs), "=r" (gs) );
 
         if ( GUEST_MODE(regs) )
         {
@@ -51,21 +49,16 @@
             ss  = regs->ss & 0xffff;
             ds  = regs->ds & 0xffff;
             es  = regs->es & 0xffff;
-            fs  = regs->fs & 0xffff;
-            gs  = regs->gs & 0xffff;
             cs  = regs->cs & 0xffff;
             context = "guest";
         }
         else
         {
-            esp = (unsigned long)(&regs->esp);
+            esp = (unsigned long)&regs->esp;
             ss  = __HYPERVISOR_DS;
             ds  = __HYPERVISOR_DS;
             es  = __HYPERVISOR_DS;
-            fs  = __HYPERVISOR_DS;
-            gs  = __HYPERVISOR_DS;
             cs  = __HYPERVISOR_CS;
-            
             context = "hypervisor";
         }
     }
@@ -78,12 +71,10 @@
            regs->eax, regs->ebx, regs->ecx, regs->edx);
     printk("esi: %08x   edi: %08x   ebp: %08x   esp: %08lx\n",
            regs->esi, regs->edi, regs->ebp, esp);
+    printk("cr0: %08lx   cr3: %08lx\n", cr0, cr3);
     printk("ds: %04lx   es: %04lx   fs: %04lx   gs: %04lx   "
            "ss: %04lx   cs: %04lx\n",
            ds, es, fs, gs, ss, cs);
-#ifdef CONFIG_VMX
-    printk("cr0: %08lx   cr3: %08lx\n", cr0, cr3);
-#endif
 
     if ( GUEST_MODE(regs) )
         show_guest_stack();

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Clean up show_registers()., BitKeeper Bot <=