From: Haozhong Zhang Date: Thu, 15 Dec 2016 10:11:45 +0000 (+0100) Subject: vvmx: return VMfail to L1 if L1 vmxon is executed in VMX operation X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~3131 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c88da9ec885252e775e1d65022d0ef4dd44dfc81;p=xen.git vvmx: return VMfail to L1 if L1 vmxon is executed in VMX operation According to Intel SDM, section "VMXON - Enter VMX Operation", a VMfail should be returned to L1 hypervisor if L1 vmxon is executed in VMX operation, rather than just print a warning message. Signed-off-by: Haozhong Zhang Reviewed-by: Andrew Cooper Acked-by: Kevin Tian --- diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c index 6197b317e3..4aaf908449 100644 --- a/xen/arch/x86/hvm/vmx/vvmx.c +++ b/xen/arch/x86/hvm/vmx/vvmx.c @@ -1380,9 +1380,12 @@ int nvmx_handle_vmxon(struct cpu_user_regs *regs) return rc; if ( nvmx_vcpu_in_vmx(v) ) - gdprintk(XENLOG_WARNING, - "vmxon again: orig %"PRIpaddr" new %lx\n", - nvmx->vmxon_region_pa, gpa); + { + vmreturn(regs, + nvcpu->nv_vvmcxaddr != VMCX_EADDR ? + VMFAIL_VALID : VMFAIL_INVALID); + return X86EMUL_OKAY; + } nvmx->vmxon_region_pa = gpa;