# HG changeset patch
# User yamahata@xxxxxxxxxxxxx
# Date 1196658771 -32400
# Node ID d2747dd30afa8e122bc74d7ae2118566a70d52ee
# Parent 9bf50d1d36f819d078d2829d1f52b6edddf969fc
Improve the VTi domain fault handler panic path.
Currently when VTi fault handler finds something wrong, it enters
vmx_panic infinit loop with interrupt masked.
It makes sense if hw-based debugger is available.
However in most cases it doesn't make sense. Especially for normal users.
This patch makes those panicing path more user friendly to print out
panic message.
The old behaviour is left with vmx_panic configuration.
PATCHNAME: config_vmx_panic
Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
diff -r 9bf50d1d36f8 -r d2747dd30afa xen/arch/ia64/Rules.mk
--- a/xen/arch/ia64/Rules.mk Mon Dec 03 14:12:47 2007 +0900
+++ b/xen/arch/ia64/Rules.mk Mon Dec 03 14:12:51 2007 +0900
@@ -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 9bf50d1d36f8 -r d2747dd30afa xen/arch/ia64/vmx/vmx_ivt.S
--- a/xen/arch/ia64/vmx/vmx_ivt.S Mon Dec 03 14:12:47 2007 +0900
+++ b/xen/arch/ia64/vmx/vmx_ivt.S Mon Dec 03 14:12:51 2007 +0900
@@ -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 9bf50d1d36f8 -r d2747dd30afa xen/arch/ia64/vmx/vmx_minstate.h
--- a/xen/arch/ia64/vmx/vmx_minstate.h Mon Dec 03 14:12:47 2007 +0900
+++ b/xen/arch/ia64/vmx/vmx_minstate.h Mon Dec 03 14:12:51 2007 +0900
@@ -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: */
\
16510_d2747dd30afa_config_vmx_panic.patch
Description: Text Data
_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
|