# HG changeset patch
# User Alex Williamson <alex.williamson@xxxxxx>
# Date 1197664677 25200
# Node ID 9ab95900afec2083fce4fe04926d67c09e0cba32
# Parent fa80218de06a7c3c81a43c6bb176a159c9d4b768
[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@xxxxxxxxxxxxx>
---
xen/arch/ia64/Rules.mk | 4 ++++
xen/arch/ia64/vmx/vmx_ivt.S | 19 ++++++++++++++++++-
xen/arch/ia64/vmx/vmx_minstate.h | 14 +++++++++++++-
3 files changed, 35 insertions(+), 2 deletions(-)
diff -r fa80218de06a -r 9ab95900afec xen/arch/ia64/Rules.mk
--- a/xen/arch/ia64/Rules.mk Fri Dec 14 13:33:01 2007 -0700
+++ b/xen/arch/ia64/Rules.mk Fri Dec 14 13:37:57 2007 -0700
@@ -7,6 +7,7 @@ xenoprof := y
xenoprof := y
no_warns ?= n
vti_debug ?= n
+vmx_panic ?= n
xen_ia64_expose_p2m ?= y
xen_ia64_pervcpu_vhpt ?= y
xen_ia64_tlb_track ?= y
@@ -39,6 +40,9 @@ CFLAGS += -g
CFLAGS += -g
ifeq ($(vti_debug),y)
CFLAGS += -DVTI_DEBUG
+endif
+ifeq ($(vmx_panic),y)
+CFLAGS += -DCONFIG_VMX_PANIC
endif
ifeq ($(xen_ia64_expose_p2m),y)
CFLAGS += -DCONFIG_XEN_IA64_EXPOSE_P2M
diff -r fa80218de06a -r 9ab95900afec xen/arch/ia64/vmx/vmx_ivt.S
--- a/xen/arch/ia64/vmx/vmx_ivt.S Fri Dec 14 13:33:01 2007 -0700
+++ b/xen/arch/ia64/vmx/vmx_ivt.S Fri Dec 14 13:37:57 2007 -0700
@@ -119,11 +119,12 @@ vmx_fault_##n:;
(p7)br.sptk.many vmx_dispatch_reflection; \
br.sptk.many dispatch_to_fault_handler
+#ifdef CONFIG_VMX_PANIC
GLOBAL_ENTRY(vmx_panic)
br.sptk.many vmx_panic
;;
END(vmx_panic)
-
+#endif
@@ -1353,6 +1354,7 @@ ENTRY(vmx_dispatch_reflection)
VMX_SAVE_REST
mov rp=r14
;;
+ P6_BR_CALL_PANIC(.Lvmx_dispatch_reflection_string)
adds out4=16,r12
br.call.sptk.many b6=vmx_reflect_interruption
END(vmx_dispatch_reflection)
@@ -1375,6 +1377,7 @@ ENTRY(vmx_dispatch_virtualization_fault)
VMX_SAVE_EXTRA
mov rp=r14
;;
+ P6_BR_CALL_PANIC(.Lvmx_dispatch_virtualization_fault_string)
adds out1=16,sp //regs
br.call.sptk.many b6=vmx_emulate
END(vmx_dispatch_virtualization_fault)
@@ -1396,6 +1399,7 @@ GLOBAL_ENTRY(vmx_dispatch_vexirq)
movl r14=ia64_leave_hypervisor
;;
mov rp=r14
+ P6_BR_CALL_PANIC(.Lvmx_dispatch_vexirq_string)
br.call.sptk.many b6=vmx_vexirq
END(vmx_dispatch_vexirq)
@@ -1416,6 +1420,7 @@ ENTRY(vmx_dispatch_tlb_miss)
VMX_SAVE_REST
mov rp=r14
;;
+ P6_BR_CALL_PANIC(.Lvmx_dispatch_tlb_miss_string)
adds out2=16,r12
br.call.sptk.many b6=vmx_hpw_miss
END(vmx_dispatch_tlb_miss)
@@ -1439,6 +1444,7 @@ ENTRY(vmx_dispatch_break_fault)
VMX_SAVE_REST
mov rp=r14
;;
+ P6_BR_CALL_PANIC(.Lvmx_dispatch_break_fault_string)
adds out1=16,sp
br.call.sptk.many b6=vmx_ia64_handle_break
;;
@@ -1463,3 +1469,14 @@ ENTRY(vmx_dispatch_interrupt)
add out1=16,sp // pass pointer to pt_regs as second arg
br.call.sptk.many b6=ia64_handle_irq
END(vmx_dispatch_interrupt)
+
+.Lvmx_dispatch_reflection_string:
+ .asciz "vmx_dispatch_reflection\n"
+.Lvmx_dispatch_virtualization_fault_string:
+ .asciz "vmx_dispatch_virtualization_fault\n"
+.Lvmx_dispatch_vexirq_string:
+ .asciz "vmx_dispatch_vexirq\n"
+.Lvmx_dispatch_tlb_miss_string:
+ .asciz "vmx_dispatch_tlb_miss\n"
+.Lvmx_dispatch_break_fault_string:
+ .asciz "vmx_dispatch_break_fault\n"
diff -r fa80218de06a -r 9ab95900afec xen/arch/ia64/vmx/vmx_minstate.h
--- a/xen/arch/ia64/vmx/vmx_minstate.h Fri Dec 14 13:33:01 2007 -0700
+++ b/xen/arch/ia64/vmx/vmx_minstate.h Fri Dec 14 13:37:57 2007 -0700
@@ -100,6 +100,8 @@
* r11 = FPSR_DEFAULT
* r12 = kernel sp (kernel virtual address)
* r13 = points to current task_struct (kernel virtual address)
+ * p6 = (psr.vm || isr.ni)
+ * panic if not external interrupt (fault in xen VMM)
* p15 = TRUE if psr.i is set in cr.ipsr
* predicate registers (other than p2, p3, and p15), b6, r3, r14, r15:
* preserved
@@ -107,6 +109,16 @@
* Note that psr.ic is NOT turned on by this macro. This is so that
* we can pass interruption state as arguments to a handler.
*/
+
+#ifdef CONFIG_VMX_PANIC
+# define P6_BR_VMX_PANIC (p6)br.spnt.few vmx_panic;
+#else
+# define P6_BR_VMX_PANIC /* nothing */
+#endif
+
+#define P6_BR_CALL_PANIC(panic_string) \
+(p6) movl out0=panic_string; \
+(p6) br.call.spnt.few b6=panic;
#define VMX_DO_SAVE_MIN(COVER,SAVE_IFS,EXTRA)
\
mov r27=ar.rsc; /* M */
\
@@ -123,7 +135,7 @@
;;
\
(pUStk) tbit.nz.and p6,p0=r18,IA64_ISR_NI_BIT;
\
;;
\
-(p6)br.spnt.few vmx_panic;
\
+ P6_BR_VMX_PANIC
\
(pUStk)VMX_MINSTATE_GET_CURRENT(r1);
\
/* mov r21=r16; */
\
/* switch from user to kernel RBS: */
\
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|