ia64/xen-unstable

changeset 15428:f50f0ec7dd2c

x86: early exception enhancement

In order to at least have some minimal debuging capabilities when Xen
crashes really early, dump out registers and stack contents in a raw
form.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Wed Jun 20 17:05:48 2007 +0100 (2007-06-20)
parents 9c6076750685
children 7825043607bc
files xen/arch/x86/boot/x86_32.S xen/arch/x86/boot/x86_64.S
line diff
     1.1 --- a/xen/arch/x86/boot/x86_32.S	Wed Jun 20 16:58:21 2007 +0100
     1.2 +++ b/xen/arch/x86/boot/x86_32.S	Wed Jun 20 17:05:48 2007 +0100
     1.3 @@ -36,15 +36,29 @@ 1:      mov     %eax,(%edi)
     1.4  
     1.5  /* This is the default interrupt handler. */
     1.6  int_msg:
     1.7 -        .asciz "Unknown interrupt\n"
     1.8 +        .asciz "Unknown interrupt (cr2=%08x)\n"
     1.9 +hex_msg:
    1.10 +        .asciz "  %08x"
    1.11          ALIGN
    1.12  ignore_int:
    1.13 +        pusha
    1.14          cld
    1.15          mov     $(__HYPERVISOR_DS),%eax
    1.16          mov     %eax,%ds
    1.17          mov     %eax,%es
    1.18 +        mov     %cr2,%eax
    1.19 +        push    %eax
    1.20          pushl   $int_msg
    1.21          call    printk
    1.22 +        add     $8,%esp
    1.23 +        mov     %esp,%ebp
    1.24 +0:      pushl   (%ebp)
    1.25 +        add     $4,%ebp
    1.26 +        pushl   $hex_msg
    1.27 +        call    printk
    1.28 +        add     $8,%esp
    1.29 +        test    $0xffc,%ebp
    1.30 +        jnz     0b
    1.31  1:      jmp     1b
    1.32  
    1.33  ENTRY(stack_start)
     2.1 --- a/xen/arch/x86/boot/x86_64.S	Wed Jun 20 16:58:21 2007 +0100
     2.2 +++ b/xen/arch/x86/boot/x86_64.S	Wed Jun 20 17:05:48 2007 +0100
     2.3 @@ -56,12 +56,23 @@ 1:      movq    %rax,(%rdi)
     2.4  
     2.5  /* This is the default interrupt handler. */
     2.6  int_msg:
     2.7 -        .asciz "Unknown interrupt\n"
     2.8 +        .asciz "Unknown interrupt (cr2=%016lx)\n"
     2.9 +hex_msg:
    2.10 +        .asciz "    %016lx"
    2.11  ignore_int:
    2.12 -        cld
    2.13 +        SAVE_ALL
    2.14 +        movq    %cr2,%rsi
    2.15          leaq    int_msg(%rip),%rdi
    2.16          xorl    %eax,%eax
    2.17          call    printk
    2.18 +        movq    %rsp,%rbp
    2.19 +0:      movq    (%rbp),%rsi
    2.20 +        addq    $8,%rbp
    2.21 +        leaq    hex_msg(%rip),%rdi
    2.22 +        xorl    %eax,%eax
    2.23 +        call    printk
    2.24 +        testq   $0xff8,%rbp
    2.25 +        jnz     0b
    2.26  1:      jmp     1b
    2.27  
    2.28