The last remaining bit is padding with two bytes. Signed-off-by: David Hildenbrand <da...@redhat.com> --- target/s390x/mem_helper.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c index f636f3a011..0366cbc753 100644 --- a/target/s390x/mem_helper.c +++ b/target/s390x/mem_helper.c @@ -900,15 +900,17 @@ static inline uint32_t do_mvcl(CPUS390XState *env, access_memset(env, *dest, pad, len, ra); *dest = wrap_address(env, *dest + len); } else { + S390Access desta = access_prepare(env, *dest, len, MMU_DATA_STORE, 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; -- 2.21.0