]> xenbits.xensource.com Git - xen.git/commitdiff
vvmx: return VMfail to L1 if L1 vmxon is executed in VMX operation
authorHaozhong Zhang <haozhong.zhang@intel.com>
Thu, 15 Dec 2016 10:11:45 +0000 (11:11 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 15 Dec 2016 10:11:45 +0000 (11:11 +0100)
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 <haozhong.zhang@intel.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
xen/arch/x86/hvm/vmx/vvmx.c

index 6197b317e30b87fac24f28cc7c2bf7378c309e28..4aaf90844939e88d3bd79d04162f8c389d3a330e 100644 (file)
@@ -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;