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>
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;
}
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,