x86emul: adjust MOVSXD source operand handling
authorJan Beulich <jbeulich@suse.com>
Fri, 4 Oct 2019 15:57:03 +0000 (17:57 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 4 Oct 2019 15:57:03 +0000 (17:57 +0200)
commit89a854301e815a6f43a695605a5a261d964fcc6b
tree7a9397bd49a8e00bfb2b7f54bcf128d2a4e0dea0
parentc9cccbdff8b5fd341e0aca03c303ed30e8b9840e
x86emul: adjust MOVSXD source operand handling

XED commit 1b2fd94425 ("Update MOVSXD to modern behavior") points out
that as of SDM rev 064 MOVSXD is specified to read only 16 bits from
memory (or register) when used without REX.W and with operand size
override. Since the upper 16 bits of the value read won't be used
anyway in this case, make the emulation uniformly follow this more
compatible behavior when not emulating an AMD-like CPU, at the risk
of missing an exception when emulating on/for older hardware (the
boundary at SandyBridge noted in said commit looks questionable - I've
observed the "new" behavior also on Westmere, and a discussion there
lead to Mark finding that even Merom has this behavior already).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
xen/arch/x86/x86_emulate/x86_emulate.c