diff options
author | David Hildenbrand <david@redhat.com> | 2019-09-05 14:56:07 +0200 |
---|---|---|
committer | David Hildenbrand <david@redhat.com> | 2019-09-23 09:28:29 +0200 |
commit | b8e7b2fe1d8125cf1283ab4076203f1363c91226 (patch) | |
tree | 85e7797ca0892e749c808ce434d4ed9008caf745 /target | |
parent | b7809f369266d6cc1a253688f80a66bfbce9e6dd (diff) | |
download | qemu-b8e7b2fe1d8125cf1283ab4076203f1363c91226.zip |
s390x/tcg: MVCLU: Fault-safe handling
The last remaining bit is padding with two bytes.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: David Hildenbrand <david@redhat.com>
Diffstat (limited to 'target')
-rw-r--r-- | target/s390x/mem_helper.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c index aed53a37da..271b1db664 100644 --- a/target/s390x/mem_helper.c +++ b/target/s390x/mem_helper.c @@ -925,15 +925,17 @@ static inline uint32_t do_mvcl(CPUS390XState *env, access_memset(env, &desta, pad, ra); *dest = wrap_address(env, *dest + len); } else { + desta = access_prepare(env, *dest, len, MMU_DATA_STORE, mmu_idx, ra); + /* The remaining length selects the padding byte. */ for (i = 0; i < len; (*destlen)--, i++) { if (*destlen & 1) { - cpu_stb_data_ra(env, *dest, pad, ra); + access_set_byte(env, &desta, i, pad, ra); } else { - cpu_stb_data_ra(env, *dest, pad >> 8, ra); + access_set_byte(env, &desta, i, pad >> 8, ra); } - *dest = wrap_address(env, *dest + 1); } + *dest = wrap_address(env, *dest + len); } return *destlen ? 3 : cc; |