Skip to contentSkip to conversation

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

PATCH In review Haozhong Zhang 3 participants 3 messages Dec 19, 2016 – Dec 20, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 xen/arch/x86/hvm/vmx/vvmx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
xen/arch/x86/hvm/vmx/vvmx.c +2 -1
index 4a5b79c..9e37d22 100644
@@ -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;
Signature · 7 lines
2.10.1


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines
Quoted 1 line
Quoted 1 line · On 19.12.16 at 02:14, <[email protected]> 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.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

Acked-by on v1 1/1
#2 lore raw
In reply to Haozhong Zhang
Quoted 8 lines

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.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel