x86/VT-x: Dump VMCS on VMLAUNCH/VMRESUME failure
PATCH 1/1 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.
---
CC: Jan Beulich <[email protected]>
CC: Jun Nakajima <[email protected]>
CC: Kevin Tian <[email protected]>
--- xen/arch/x86/hvm/vmx/vmcs.c | 5 +++++ xen/include/asm-x86/hvm/vmx/vmcs.h | 4 ++++ 2 files changed, 9 insertions(+)
xen/arch/x86/hvm/vmx/vmcs.c +5 -0
@@ -1637,6 +1637,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 (); }
xen/include/asm-x86/hvm/vmx/vmcs.h +4 -0
@@ -567,6 +567,10 @@ enum vmcs_field {#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);
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
Quoted 7 lines
From: Andrew Cooper [mailto:[email protected]]
Sent: Saturday, July 02, 2016 1:53 AMIf a VMLAUNCH/VMRESUME fails due to invalid control or host state, dump the VMCS before crashing the domain.
Signed-off-by Andrew Cooper <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 01.07.16 at 19:52, <[email protected]> wrote:
If a VMLAUNCH/VMRESUME fails due to invalid control or host state, dump the VMCS before crashing the domain.
Signed-off-by Andrew Cooper <[email protected]>
Good idea:
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel