[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Correctly handle dumping a VM86 guest's stack.



# HG changeset patch
# User Ian.Campbell@xxxxxxxxxxxxx
# Node ID 3f702887d4a62931182392c07436dcdba93a77ea
# Parent  c1840ac1f05d32fb6c4b39253b53c301167c2e75
Correctly handle dumping a VM86 guest's stack.

If the guest context is VM86 then we need to treat ss:sp as 16 bit
segment:offset rather than 32 bit selector:offset.

Signed-off-by: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>

diff -r c1840ac1f05d -r 3f702887d4a6 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c      Fri Jan 13 15:44:04 2006
+++ b/xen/arch/x86/traps.c      Fri Jan 13 16:56:09 2006
@@ -130,9 +130,19 @@
 static void show_guest_stack(struct cpu_user_regs *regs)
 {
     int i;
-    unsigned long *stack = (unsigned long *)regs->esp, addr;
-
-    printk("Guest stack trace from "__OP"sp=%p:\n   ", stack);
+    unsigned long *stack, addr;
+
+    if ( VM86_MODE(regs) )
+    {
+        stack = (unsigned long *)((regs->ss << 4) + (regs->esp & 0xffff));
+        printk("Guest stack trace from ss:sp = %04x:%04x (VM86)\n   ",
+               regs->ss, (uint16_t)(regs->esp & 0xffff));
+    }
+    else
+    {
+        stack = (unsigned long *)regs->esp;
+        printk("Guest stack trace from "__OP"sp=%p:\n   ", stack);
+    }
 
     for ( i = 0; i < (debug_stack_lines*stack_words_per_line); i++ )
     {

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.