diff mbox

vvmx: fix the wrong address width in c/s 08fac63

Message ID 20161219011422.16836-1-haozhong.zhang@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Haozhong Zhang Dec. 19, 2016, 1:14 a.m. UTC
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>
---
 xen/arch/x86/hvm/vmx/vvmx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Jan Beulich Dec. 19, 2016, 7:57 a.m. UTC | #1
>>> On 19.12.16 at 02:14, <haozhong.zhang@intel.com> wrote:
> 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>
Tian, Kevin Dec. 20, 2016, 5:04 a.m. UTC | #2
> From: Zhang, Haozhong
> Sent: Monday, December 19, 2016 9:14 AM
> 
> 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>

Acked-by: Kevin Tian <kevin.tian@intel.com>
diff mbox

Patch

diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 4a5b79c..9e37d22 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -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;