Message ID | 20161219011422.16836-1-haozhong.zhang@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
>>> 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>
> 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 --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;
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(-)