diff mbox series

[PULL,06/34] s390x/tcg: MVC: Use is_destructive_overlap()

Message ID 20190919124115.11510-7-cohuck@redhat.com (mailing list archive)
State New, archived
Headers show
Series [PULL,01/34] s390x/tcg: Reset exception_index to -1 instead of 0 | expand

Commit Message

Cornelia Huck Sept. 19, 2019, 12:40 p.m. UTC
From: David Hildenbrand <david@redhat.com>

Let's use the new helper, that also detects destructive overlaps when
wrapping.

We'll make the remaining code (e.g., fast_memmove()) aware of wrapping
later.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: David Hildenbrand <david@redhat.com>
---
 target/s390x/mem_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c
index 013e8d6045e7..c31cf4959358 100644
--- a/target/s390x/mem_helper.c
+++ b/target/s390x/mem_helper.c
@@ -330,7 +330,7 @@  static uint32_t do_helper_mvc(CPUS390XState *env, uint32_t l, uint64_t dest,
      */
     if (dest == src + 1) {
         fast_memset(env, dest, cpu_ldub_data_ra(env, src, ra), l, ra);
-    } else if (dest < src || src + l <= dest) {
+    } else if (!is_destructive_overlap(env, dest, src, l)) {
         fast_memmove(env, dest, src, l, ra);
     } else {
         for (i = 0; i < l; i++) {