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

[Xen-changelog] [xen stable-4.6] x86/VT-x: Dump VMCS on VMLAUNCH/VMRESUME failure



commit 746dca5ef65b6456620822a9444be62f77be6e4d
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Mon Feb 20 16:04:52 2017 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Feb 20 16:04:52 2017 +0100

    x86/VT-x: Dump VMCS on VMLAUNCH/VMRESUME failure
    
    If a VMLAUNCH/VMRESUME fails due to invalid control or host state, dump the
    VMCS before crashing the domain.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Acked-by: Kevin Tian <kevin.tian@xxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
    master commit: d0fd9ae54491328b10dee4003656c14b3bf3d3e9
    master date: 2016-07-04 10:51:48 +0100
---
 xen/arch/x86/hvm/vmx/vmcs.c        | 5 +++++
 xen/include/asm-x86/hvm/vmx/vmcs.h | 4 ++++
 2 files changed, 9 insertions(+)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 057ef37..321e5bc 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -1598,6 +1598,11 @@ void vmx_vmentry_failure(void)
     __vmread(VM_INSTRUCTION_ERROR, &error);
     gprintk(XENLOG_ERR, "VM%s error: %#lx\n",
             curr->arch.hvm_vmx.launched ? "RESUME" : "LAUNCH", error);
+
+    if ( error == VMX_INSN_INVALID_CONTROL_STATE ||
+         error == VMX_INSN_INVALID_HOST_STATE )
+        vmcs_dump_vcpu(curr);
+
     domain_crash_synchronous();
 }
 
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h 
b/xen/include/asm-x86/hvm/vmx/vmcs.h
index 83c50e9..b40a625 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -487,6 +487,10 @@ extern const unsigned int 
vmx_introspection_force_enabled_msrs_size;
 #define VMX_GUEST_MSR 0
 #define VMX_HOST_MSR  1
 
+/* VM Instruction error numbers. */
+#define VMX_INSN_INVALID_CONTROL_STATE       7
+#define VMX_INSN_INVALID_HOST_STATE          8
+
 void vmx_disable_intercept_for_msr(struct vcpu *v, u32 msr, int type);
 void vmx_enable_intercept_for_msr(struct vcpu *v, u32 msr, int type);
 int vmx_read_guest_msr(u32 msr, u64 *val);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

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