]> xenbits.xensource.com Git - people/pauldu/xen.git/commitdiff
x86/vvmx: add VMX_INSN_VMPTRLD_WITH_VMXON_PTR errno
authorSergey Dyasli <sergey.dyasli@citrix.com>
Wed, 14 Nov 2018 10:23:20 +0000 (10:23 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 14 Nov 2018 18:42:48 +0000 (18:42 +0000)
And make nvmx_handle_vmptrld() return the new errno in case the provided
address is the same as vmxon region address.

While at it, correct the return value for not-4KB-aligned case.

Signed-off-by: Sergey Dyasli <sergey.dyasli@citrix.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
xen/arch/x86/hvm/vmx/vvmx.c
xen/include/asm-x86/hvm/vmx/vmcs.h

index 206a4a44fb5994f39c5ca9c52f12a81c4477a6e6..4391cd314ad9147b4ee1870313274bb93f2057d0 100644 (file)
@@ -1650,9 +1650,15 @@ static int nvmx_handle_vmptrld(struct cpu_user_regs *regs)
     if ( rc != X86EMUL_OKAY )
         return rc;
 
-    if ( gpa == vcpu_2_nvmx(v).vmxon_region_pa || gpa & 0xfff )
+    if ( gpa & 0xfff )
     {
-        vmfail_invalid(regs);
+        vmfail(regs, VMX_INSN_VMPTRLD_INVALID_PHYADDR);
+        goto out;
+    }
+
+    if ( gpa == vcpu_2_nvmx(v).vmxon_region_pa )
+    {
+        vmfail(regs, VMX_INSN_VMPTRLD_WITH_VMXON_PTR);
         goto out;
     }
 
index 6d0ae56fc14abdf9c57a745829e19e7a8607ec89..eae4e5397efb8b7578492a9f74601db34888995a 100644 (file)
@@ -534,6 +534,7 @@ enum vmx_insn_errno
     VMX_INSN_INVALID_CONTROL_STATE         = 7,
     VMX_INSN_INVALID_HOST_STATE            = 8,
     VMX_INSN_VMPTRLD_INVALID_PHYADDR       = 9,
+    VMX_INSN_VMPTRLD_WITH_VMXON_PTR        = 10,
     VMX_INSN_VMPTRLD_INCORRECT_VMCS_ID     = 11,
     VMX_INSN_UNSUPPORTED_VMCS_COMPONENT    = 12,
     VMX_INSN_VMXON_IN_VMX_ROOT             = 15,