]> xenbits.xensource.com Git - xen.git/commit
x86emul: further correct 64-bit mode zero count repeated string insn handling
authorJan Beulich <jbeulich@suse.com>
Mon, 17 Feb 2025 12:30:21 +0000 (13:30 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 17 Feb 2025 12:30:21 +0000 (13:30 +0100)
commit01651b31a77fa710fabffe9c3f9ca323083d2d15
tree2d04ad632a792ee04c906db6ee1a813ed8e538c9
parent413945d3eeebba66b2613d24192f53f73117717c
x86emul: further correct 64-bit mode zero count repeated string insn handling

In an entirely different context I came across Linux commit 428e3d08574b
("KVM: x86: Fix zero iterations REP-string"), which points out that
we're still doing things wrong: For one, there's no zero-extension at
all on AMD. And then while RCX is zero-extended from 32 bits uniformly
for all string instructions on newer hardware, RSI/RDI are only for MOVS
and STOS on the systems I have access to. (On an old family 0xf system
I've further found that for REP LODS even RCX is not zero-extended.)

While touching the lines anyway, replace two casts in get_rep_prefix().

Fixes: 79e996a89f69 ("x86emul: correct 64-bit mode repeated string insn handling with zero count")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
master commit: 5310a042c4e3135c471446c8253ad13250539957
master date: 2025-01-27 15:23:19 +0100
xen/arch/x86/x86_emulate/x86_emulate.c