]> xenbits.xensource.com Git - people/dwmw2/xen.git/commitdiff
x86emul: 16-bit XBEGIN does not truncate rIP
authorJan Beulich <jbeulich@suse.com>
Mon, 25 Nov 2019 15:22:53 +0000 (16:22 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 25 Nov 2019 15:22:53 +0000 (16:22 +0100)
SDM rev 071 points out this fact explicitly.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
master commit: a72c508656c0a0fa573890b290064e6035971f86
master date: 2019-11-15 14:15:31 +0100

xen/arch/x86/x86_emulate/x86_emulate.c

index 9525b4d25461ac53e5abd75331ed01be3da6b790..1f0c208fc5773a4c7f424eac5ae367f032ff3c22 100644 (file)
@@ -3814,10 +3814,12 @@ x86_emulate(
         {
             /*
              * xbegin unconditionally aborts, xabort is unconditionally
-             * a nop.
+             * a nop. It also does not truncate the destination address to
+             * 16 bits when 16-bit operand size is in effect.
              */
             if ( b & 1 )
             {
+                op_bytes = 4;
                 jmp_rel((int32_t)src.val);
                 _regs.r(ax) = 0;
             }