x86emul: 16-bit XBEGIN does not truncate rIP
diff mbox series

Message ID 4a7245c0-5204-dfd4-be4c-a1ee4ca52adf@suse.com
State New
Headers show
Series
  • x86emul: 16-bit XBEGIN does not truncate rIP
Related show

Commit Message

Jan Beulich Nov. 14, 2019, 10:13 a.m. UTC
SDM rev 071 points out this fact explicitly.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

Comments

Andrew Cooper Nov. 14, 2019, 10:23 a.m. UTC | #1
On 14/11/2019 10:13, Jan Beulich wrote:
> SDM rev 071 points out this fact explicitly.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Yes - I found the same note in -071.

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Jürgen Groß Nov. 14, 2019, 10:26 a.m. UTC | #2
On 14.11.19 11:13, Jan Beulich wrote:
> SDM rev 071 points out this fact explicitly.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Release-acked-by: Juergen Gross <jgross@suse.com>


Juergen

Patch
diff mbox series

--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -4246,10 +4246,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;
             }