ia64/xen-unstable

changeset 8597:3f702887d4a6

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@XenSource.com>
author Ian.Campbell@xensource.com
date Fri Jan 13 16:56:09 2006 +0000 (2006-01-13)
parents c1840ac1f05d
children f5ab28885c75 468d2a6fc0af
files xen/arch/x86/traps.c
line diff
     1.1 --- a/xen/arch/x86/traps.c	Fri Jan 13 16:44:04 2006 +0100
     1.2 +++ b/xen/arch/x86/traps.c	Fri Jan 13 16:56:09 2006 +0000
     1.3 @@ -130,9 +130,19 @@ unsigned long kernel_text_end(void)
     1.4  static void show_guest_stack(struct cpu_user_regs *regs)
     1.5  {
     1.6      int i;
     1.7 -    unsigned long *stack = (unsigned long *)regs->esp, addr;
     1.8 +    unsigned long *stack, addr;
     1.9  
    1.10 -    printk("Guest stack trace from "__OP"sp=%p:\n   ", stack);
    1.11 +    if ( VM86_MODE(regs) )
    1.12 +    {
    1.13 +        stack = (unsigned long *)((regs->ss << 4) + (regs->esp & 0xffff));
    1.14 +        printk("Guest stack trace from ss:sp = %04x:%04x (VM86)\n   ",
    1.15 +               regs->ss, (uint16_t)(regs->esp & 0xffff));
    1.16 +    }
    1.17 +    else
    1.18 +    {
    1.19 +        stack = (unsigned long *)regs->esp;
    1.20 +        printk("Guest stack trace from "__OP"sp=%p:\n   ", stack);
    1.21 +    }
    1.22  
    1.23      for ( i = 0; i < (debug_stack_lines*stack_words_per_line); i++ )
    1.24      {