ia64/xen-unstable

changeset 16757:9ab95900afec

[IA64] vti fault handler clean up: improve the VTi domain fault handler

Improve the VTi domain fault handler panic path. Currently when a
VTi fault handler finds something wrong, it enters an infinite loop
in vmx_panic with interrupts masked. It makes sense if hw-based
debugger is available. However in most cases this isn't available,
especially for normal users. This patch makes those panic paths
more user friendly by printing out the panic message. The old
behaviour is left with vmx_panic configuration.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Alex Williamson <alex.williamson@hp.com>
date Fri Dec 14 13:37:57 2007 -0700 (2007-12-14)
parents fa80218de06a
children 5ab3288e5b0f
files xen/arch/ia64/Rules.mk xen/arch/ia64/vmx/vmx_ivt.S xen/arch/ia64/vmx/vmx_minstate.h
line diff
     1.1 --- a/xen/arch/ia64/Rules.mk	Fri Dec 14 13:33:01 2007 -0700
     1.2 +++ b/xen/arch/ia64/Rules.mk	Fri Dec 14 13:37:57 2007 -0700
     1.3 @@ -7,6 +7,7 @@ HAS_VGA  := y
     1.4  xenoprof := y
     1.5  no_warns ?= n
     1.6  vti_debug ?= n
     1.7 +vmx_panic ?= n
     1.8  xen_ia64_expose_p2m	?= y
     1.9  xen_ia64_pervcpu_vhpt	?= y
    1.10  xen_ia64_tlb_track	?= y
    1.11 @@ -40,6 +41,9 @@ CFLAGS	+= -g
    1.12  ifeq ($(vti_debug),y)
    1.13  CFLAGS  += -DVTI_DEBUG
    1.14  endif
    1.15 +ifeq ($(vmx_panic),y)
    1.16 +CFLAGS  += -DCONFIG_VMX_PANIC
    1.17 +endif
    1.18  ifeq ($(xen_ia64_expose_p2m),y)
    1.19  CFLAGS	+= -DCONFIG_XEN_IA64_EXPOSE_P2M
    1.20  endif
     2.1 --- a/xen/arch/ia64/vmx/vmx_ivt.S	Fri Dec 14 13:33:01 2007 -0700
     2.2 +++ b/xen/arch/ia64/vmx/vmx_ivt.S	Fri Dec 14 13:37:57 2007 -0700
     2.3 @@ -119,11 +119,12 @@ vmx_fault_##n:;                         
     2.4  (p7)br.sptk.many vmx_dispatch_reflection;           \
     2.5      br.sptk.many dispatch_to_fault_handler
     2.6  
     2.7 +#ifdef CONFIG_VMX_PANIC
     2.8  GLOBAL_ENTRY(vmx_panic)
     2.9      br.sptk.many vmx_panic
    2.10      ;;
    2.11  END(vmx_panic)
    2.12 -
    2.13 +#endif
    2.14  
    2.15  
    2.16  
    2.17 @@ -1353,6 +1354,7 @@ ENTRY(vmx_dispatch_reflection)
    2.18      VMX_SAVE_REST
    2.19      mov rp=r14
    2.20      ;;
    2.21 +    P6_BR_CALL_PANIC(.Lvmx_dispatch_reflection_string)
    2.22      adds out4=16,r12
    2.23      br.call.sptk.many b6=vmx_reflect_interruption
    2.24  END(vmx_dispatch_reflection)
    2.25 @@ -1375,6 +1377,7 @@ ENTRY(vmx_dispatch_virtualization_fault)
    2.26      VMX_SAVE_EXTRA
    2.27      mov rp=r14
    2.28      ;;
    2.29 +    P6_BR_CALL_PANIC(.Lvmx_dispatch_virtualization_fault_string)
    2.30      adds out1=16,sp         //regs
    2.31      br.call.sptk.many b6=vmx_emulate
    2.32  END(vmx_dispatch_virtualization_fault)
    2.33 @@ -1396,6 +1399,7 @@ GLOBAL_ENTRY(vmx_dispatch_vexirq)
    2.34      movl r14=ia64_leave_hypervisor
    2.35      ;;
    2.36      mov rp=r14
    2.37 +    P6_BR_CALL_PANIC(.Lvmx_dispatch_vexirq_string)
    2.38      br.call.sptk.many b6=vmx_vexirq
    2.39  END(vmx_dispatch_vexirq)
    2.40  
    2.41 @@ -1416,6 +1420,7 @@ ENTRY(vmx_dispatch_tlb_miss)
    2.42      VMX_SAVE_REST
    2.43      mov rp=r14
    2.44      ;;
    2.45 +    P6_BR_CALL_PANIC(.Lvmx_dispatch_tlb_miss_string)
    2.46      adds out2=16,r12
    2.47      br.call.sptk.many b6=vmx_hpw_miss
    2.48  END(vmx_dispatch_tlb_miss)
    2.49 @@ -1439,6 +1444,7 @@ ENTRY(vmx_dispatch_break_fault)
    2.50      VMX_SAVE_REST
    2.51      mov rp=r14
    2.52      ;;
    2.53 +    P6_BR_CALL_PANIC(.Lvmx_dispatch_break_fault_string)
    2.54      adds out1=16,sp
    2.55      br.call.sptk.many b6=vmx_ia64_handle_break
    2.56      ;;
    2.57 @@ -1463,3 +1469,14 @@ ENTRY(vmx_dispatch_interrupt)
    2.58      add out1=16,sp		// pass pointer to pt_regs as second arg
    2.59      br.call.sptk.many b6=ia64_handle_irq
    2.60  END(vmx_dispatch_interrupt)
    2.61 +
    2.62 +.Lvmx_dispatch_reflection_string:
    2.63 +    .asciz "vmx_dispatch_reflection\n"
    2.64 +.Lvmx_dispatch_virtualization_fault_string:
    2.65 +    .asciz "vmx_dispatch_virtualization_fault\n"
    2.66 +.Lvmx_dispatch_vexirq_string:
    2.67 +    .asciz "vmx_dispatch_vexirq\n"
    2.68 +.Lvmx_dispatch_tlb_miss_string:
    2.69 +    .asciz "vmx_dispatch_tlb_miss\n"
    2.70 +.Lvmx_dispatch_break_fault_string:
    2.71 +    .asciz "vmx_dispatch_break_fault\n"
     3.1 --- a/xen/arch/ia64/vmx/vmx_minstate.h	Fri Dec 14 13:33:01 2007 -0700
     3.2 +++ b/xen/arch/ia64/vmx/vmx_minstate.h	Fri Dec 14 13:37:57 2007 -0700
     3.3 @@ -100,6 +100,8 @@
     3.4   *  r11 = FPSR_DEFAULT
     3.5   *  r12 = kernel sp (kernel virtual address)
     3.6   *  r13 = points to current task_struct (kernel virtual address)
     3.7 + *   p6 = (psr.vm || isr.ni)
     3.8 + *        panic if not external interrupt (fault in xen VMM)
     3.9   *  p15 = TRUE if psr.i is set in cr.ipsr
    3.10   *  predicate registers (other than p2, p3, and p15), b6, r3, r14, r15:
    3.11   *      preserved
    3.12 @@ -108,6 +110,16 @@
    3.13   * we can pass interruption state as arguments to a handler.
    3.14   */
    3.15  
    3.16 +#ifdef CONFIG_VMX_PANIC
    3.17 +# define P6_BR_VMX_PANIC        (p6)br.spnt.few vmx_panic;
    3.18 +#else
    3.19 +# define P6_BR_VMX_PANIC        /* nothing */
    3.20 +#endif
    3.21 +
    3.22 +#define P6_BR_CALL_PANIC(panic_string)  \
    3.23 +(p6) movl out0=panic_string;            \
    3.24 +(p6) br.call.spnt.few b6=panic;
    3.25 +
    3.26  #define VMX_DO_SAVE_MIN(COVER,SAVE_IFS,EXTRA)                                           \
    3.27      mov r27=ar.rsc;                     /* M */                                         \
    3.28      mov r20=r1;                         /* A */                                         \
    3.29 @@ -123,7 +135,7 @@
    3.30      ;;                                                                                  \
    3.31  (pUStk) tbit.nz.and p6,p0=r18,IA64_ISR_NI_BIT;                                          \
    3.32      ;;                                                                                  \
    3.33 -(p6)br.spnt.few vmx_panic;                                                              \
    3.34 +    P6_BR_VMX_PANIC                                                                     \
    3.35  (pUStk)VMX_MINSTATE_GET_CURRENT(r1);                                                    \
    3.36      /*    mov r21=r16;  */                                                              \
    3.37      /* switch from user to kernel RBS: */                                               \