From: David Hildenbrand Date: Wed, 4 Sep 2019 09:30:29 +0000 (+0200) Subject: s390x/tcg: MVC: Fault-safe handling on destructive overlaps X-Git-Tag: v4.2.0-rc0~87^2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7809f369266d6cc1a253688f80a66bfbce9e6dd;p=thirdparty%2Fqemu.git s390x/tcg: MVC: Fault-safe handling on destructive overlaps The last remaining bit for MVC is handling destructive overlaps in a fault-safe way. Reviewed-by: Richard Henderson Signed-off-by: David Hildenbrand --- diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c index 04c4228f135..aed53a37dae 100644 --- a/target/s390x/mem_helper.c +++ b/target/s390x/mem_helper.c @@ -438,8 +438,9 @@ static uint32_t do_helper_mvc(CPUS390XState *env, uint32_t l, uint64_t dest, access_memmove(env, &desta, &srca, ra); } else { for (i = 0; i < l; i++) { - uint8_t x = cpu_ldub_data_ra(env, src + i, ra); - cpu_stb_data_ra(env, dest + i, x, ra); + uint8_t byte = access_get_byte(env, &srca, i, ra); + + access_set_byte(env, &desta, i, byte, ra); } }