vvmx: fix the wrong address width in c/s 08fac63
authorHaozhong Zhang <haozhong.zhang@intel.com>
Tue, 20 Dec 2016 08:51:45 +0000 (09:51 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 20 Dec 2016 08:51:45 +0000 (09:51 +0100)
c/s 08fac63 misused v->domain-arch.paging.gfn_bits as the width of
guest physical address and missed adding PAGE_SHIFT to it when
checking vmxon operand.

Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
xen/arch/x86/hvm/vmx/vvmx.c

index 4a5b79cabd39d3316bc152385efb9446c2e2b67d..9e37d223a4f4e84370b99e48edf4b1a4bdcc1bf8 100644 (file)
@@ -1388,7 +1388,8 @@ int nvmx_handle_vmxon(struct cpu_user_regs *regs)
         return X86EMUL_OKAY;
     }
 
-    if ( (gpa & ~PAGE_MASK) || (gpa >> v->domain->arch.paging.gfn_bits) )
+    if ( (gpa & ~PAGE_MASK) ||
+         (gpa >> (v->domain->arch.paging.gfn_bits + PAGE_SHIFT)) )
     {
         vmreturn(regs, VMFAIL_INVALID);
         return X86EMUL_OKAY;