From: Jan Beulich Date: Wed, 11 Oct 2017 12:50:33 +0000 (+0200) Subject: x86emul: handle address wrapping for VMASKMOVP{S,D} X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~1133 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=95d0a0fe37ee89bfb11ab952b7831c849cf23bd4;p=xen.git x86emul: handle address wrapping for VMASKMOVP{S,D} I failed to recognize the need to mirror the changes done by 7869e2bafe ("x86emul/fuzz: add rudimentary limit checking") into the earlier written but later committed 2fe43d333f ("x86emul: support remaining AVX insns"): Behavior here is the same as for multi-part reads or writes. Reported-by: Andrew Cooper Signed-off-by: Jan Beulich Acked-by: Andrew Cooper --- diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c index d9bcd314ec..54a275664a 100644 --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -7887,7 +7887,7 @@ x86_emulate( switch ( d & SrcMask ) { case SrcMem: - rc = ops->read(ea.mem.seg, ea.mem.off + first_byte, + rc = ops->read(ea.mem.seg, truncate_ea(ea.mem.off + first_byte), (void *)mmvalp + first_byte, op_bytes, ctxt); if ( rc != X86EMUL_OKAY ) @@ -7970,7 +7970,7 @@ x86_emulate( else { fail_if(!ops->write); - rc = ops->write(dst.mem.seg, dst.mem.off + first_byte, + rc = ops->write(dst.mem.seg, truncate_ea(dst.mem.off + first_byte), !state->simd_size ? &dst.val : (void *)mmvalp + first_byte, dst.bytes, ctxt);