[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [IA64] display vmx fault messges



# HG changeset patch
# User awilliam@xxxxxxxxxxx
# Node ID 602f5965e217ba986c22659c04b379e74be90c22
# Parent  df67fa9b1376b126269dae364aa9f5b7a0ffa325
[IA64] display vmx fault messges

This patch modifies the vmx fault handler to display a message when a
fault occurs in hypervisor.

This includes the followings:

- Break 0 handler is modified to check psr.vm bit instead of cpl.
- External interrupt handler is modified to get current using
MINSTATE_GET_CURRENT instead of r21.  r21 has been used in DO_SAVE_MIN
which is called from other fault handlers.  I'm not sure why the
original vmx fault handler gets the current from r21.

Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
Signed-off-by: Tetsu Yamamoto <yamamoto.tetsu@xxxxxxxxxxxxxx>
---
 xen/arch/ia64/vmx/vmx_ivt.S     |    6 ++++--
 xen/arch/ia64/vmx/vmx_process.c |    2 +-
 xen/arch/ia64/xen/ivt.S         |    2 +-
 xen/arch/ia64/xen/xenmisc.c     |   12 ++++++++++++
 xen/include/asm-ia64/vmx.h      |    1 +
 5 files changed, 19 insertions(+), 4 deletions(-)

diff -r df67fa9b1376 -r 602f5965e217 xen/arch/ia64/vmx/vmx_ivt.S
--- a/xen/arch/ia64/vmx/vmx_ivt.S       Mon Jun 19 13:35:49 2006 -0600
+++ b/xen/arch/ia64/vmx/vmx_ivt.S       Mon Jun 19 13:42:34 2006 -0600
@@ -88,11 +88,13 @@
 
 #include "vmx_minstate.h"
 
+#define MINSTATE_VIRT  /* needed by minstate.h */
+#include "minstate.h"
 
 
 #define VMX_FAULT(n)    \
 vmx_fault_##n:;          \
-    br.sptk vmx_fault_##n;         \
+    br.sptk.many dispatch_to_fault_handler;         \
     ;;                  \
 
 
@@ -508,7 +510,7 @@ ENTRY(vmx_interrupt)
     ;;
 .mem.offset 0,0; st8.spill [r16]=r13,16
 .mem.offset 8,0; st8.spill [r17]=r8,16 /* save ar.fpsr */
-    mov r13=r21    /* establish `current' */
+    MINSTATE_GET_CURRENT(r13)
     ;;
 .mem.offset 0,0; st8.spill [r16]=r15,16
 .mem.offset 8,0; st8.spill [r17]=r14,16
diff -r df67fa9b1376 -r 602f5965e217 xen/arch/ia64/vmx/vmx_process.c
--- a/xen/arch/ia64/vmx/vmx_process.c   Mon Jun 19 13:35:49 2006 -0600
+++ b/xen/arch/ia64/vmx/vmx_process.c   Mon Jun 19 13:42:34 2006 -0600
@@ -125,7 +125,7 @@ vmx_ia64_handle_break (unsigned long ifa
 #endif
     {
         if (iim == 0) 
-            die_if_kernel("bug check", regs, iim);
+            vmx_die_if_kernel("Break 0 in Hypervisor.", regs, iim);
 
         if (!user_mode(regs)) {
             /* Allow hypercalls only when cpl = 0.  */
diff -r df67fa9b1376 -r 602f5965e217 xen/arch/ia64/xen/ivt.S
--- a/xen/arch/ia64/xen/ivt.S   Mon Jun 19 13:35:49 2006 -0600
+++ b/xen/arch/ia64/xen/ivt.S   Mon Jun 19 13:42:34 2006 -0600
@@ -1493,7 +1493,7 @@ END(dispatch_unaligned_handler)
         * suitable spot...
         */
 
-ENTRY(dispatch_to_fault_handler)
+GLOBAL_ENTRY(dispatch_to_fault_handler)
        /*
         * Input:
         *      psr.ic: off
diff -r df67fa9b1376 -r 602f5965e217 xen/arch/ia64/xen/xenmisc.c
--- a/xen/arch/ia64/xen/xenmisc.c       Mon Jun 19 13:35:49 2006 -0600
+++ b/xen/arch/ia64/xen/xenmisc.c       Mon Jun 19 13:42:34 2006 -0600
@@ -19,6 +19,7 @@
 #include <public/sched.h>
 #include <asm/vhpt.h>
 #include <asm/debugger.h>
+#include <asm/vmx.h>
 #include <asm/vmx_vcpu.h>
 #include <asm/vcpu.h>
 
@@ -109,6 +110,17 @@ void die_if_kernel(char *str, struct pt_
        domain_crash_synchronous();
 }
 
+void vmx_die_if_kernel(char *str, struct pt_regs *regs, long err) /* 
__attribute__ ((noreturn)) */
+{
+       if (vmx_user_mode(regs))
+               return;
+
+       printk("%s: %s %ld\n", __func__, str, err);
+       debugtrace_dump();
+       show_registers(regs);
+       domain_crash_synchronous();
+}
+
 long
 ia64_peek (struct task_struct *child, struct switch_stack *child_stack,
           unsigned long user_rbs_end, unsigned long addr, long *val)
diff -r df67fa9b1376 -r 602f5965e217 xen/include/asm-ia64/vmx.h
--- a/xen/include/asm-ia64/vmx.h        Mon Jun 19 13:35:49 2006 -0600
+++ b/xen/include/asm-ia64/vmx.h        Mon Jun 19 13:42:34 2006 -0600
@@ -24,6 +24,7 @@
 
 #define RR7_SWITCH_SHIFT       12      /* 4k enough */
 #include <public/hvm/ioreq.h>
+#define vmx_user_mode(regs) (((struct ia64_psr *)&(regs)->cr_ipsr)->vm == 1)
 
 #define VCPU_LID(v) (((u64)(v)->vcpu_id)<<24)
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.