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

[Xen-devel] [PATCH] x86/hvm: Print %cs:%rip in triple fault error message



It provides a little more information than just "something went wrong".

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Jan Beulich <JBeulich@xxxxxxxx>
---
 xen/arch/x86/hvm/emulate.c        | 2 +-
 xen/arch/x86/hvm/hvm.c            | 8 ++++++--
 xen/include/asm-x86/hvm/emulate.h | 1 +
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index fef7905..1f2d4a7 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -1907,7 +1907,7 @@ struct segment_register *hvmemul_get_seg_reg(
     return &hvmemul_ctxt->seg_reg[seg];
 }
 
-static const char *guest_x86_mode_to_str(int mode)
+const char *guest_x86_mode_to_str(int mode)
 {
     switch ( mode )
     {
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index a29c421..87b3cce 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2887,10 +2887,14 @@ void hvm_triple_fault(void)
     struct vcpu *v = current;
     struct domain *d = v->domain;
     u8 reason = d->arch.hvm_domain.params[HVM_PARAM_TRIPLE_FAULT_REASON];
+    const char *mode_str = guest_x86_mode_to_str(hvm_guest_x86_mode(v));
+    struct segment_register cs;
+
+    hvm_get_segment_register(v, x86_seg_cs, &cs);
 
     gprintk(XENLOG_INFO,
-            "Triple fault - invoking HVM shutdown action %d\n",
-            reason);
+            "Triple fault %s @ %04x:%08lx - invoking HVM shutdown action %d\n",
+            mode_str, cs.sel, guest_cpu_user_regs()->rip, reason);
     domain_shutdown(d, reason);
 }
 
diff --git a/xen/include/asm-x86/hvm/emulate.h 
b/xen/include/asm-x86/hvm/emulate.h
index 142d1b6..c7148c9 100644
--- a/xen/include/asm-x86/hvm/emulate.h
+++ b/xen/include/asm-x86/hvm/emulate.h
@@ -64,6 +64,7 @@ int hvmemul_do_pio_buffer(uint16_t port,
                           uint8_t dir,
                           void *buffer);
 
+const char *guest_x86_mode_to_str(int mode);
 void hvm_dump_emulation_state(const char *prefix,
                               struct hvm_emulate_ctxt *hvmemul_ctxt);
 
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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