From: Haozhong Zhang Date: Tue, 20 Dec 2016 08:51:45 +0000 (+0100) Subject: vvmx: fix the wrong address width in c/s 08fac63 X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~3105 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=1cb650c3191f8b85defb4d2ab6f183fa2926e494;p=xen.git vvmx: fix the wrong address width in c/s 08fac63 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 Reviewed-by: Jan Beulich Acked-by: Kevin Tian --- diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c index 4a5b79cabd..9e37d223a4 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;