[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-7.2.3 39/45] target/arm: Fix vd == vm overlap in sve_ldff1_z
From: |
Michael Tokarev |
Subject: |
[Stable-7.2.3 39/45] target/arm: Fix vd == vm overlap in sve_ldff1_z |
Date: |
Tue, 23 May 2023 13:17:16 +0300 |
From: Richard Henderson <richard.henderson@linaro.org>
If vd == vm, copy vm to scratch, so that we can pre-zero
the output and still access the gather indicies.
Cc: qemu-stable@nongnu.org
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1612
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20230504104232.1877774-1-richard.henderson@linaro.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit a6771f2f5cbfbf312e2fb5b1627f38a6bf6321d0)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c
index 521fc9b969..27838fb6e2 100644
--- a/target/arm/sve_helper.c
+++ b/target/arm/sve_helper.c
@@ -6726,6 +6726,7 @@ void sve_ldff1_z(CPUARMState *env, void *vd, uint64_t
*vg, void *vm,
intptr_t reg_off;
SVEHostPage info;
target_ulong addr, in_page;
+ ARMVectorReg scratch;
/* Skip to the first true predicate. */
reg_off = find_next_active(vg, 0, reg_max, esz);
@@ -6735,6 +6736,11 @@ void sve_ldff1_z(CPUARMState *env, void *vd, uint64_t
*vg, void *vm,
return;
}
+ /* Protect against overlap between vd and vm. */
+ if (unlikely(vd == vm)) {
+ vm = memcpy(&scratch, vm, reg_max);
+ }
+
/*
* Probe the first element, allowing faults.
*/
--
2.39.2
- [Stable-7.2.3 v2 00/42] Patch Round-up for stable 7.2.3, freeze on 2023-05-27, Michael Tokarev, 2023/05/23
- [Stable-7.2.3 27/45] s390x/tcg: Fix LDER instruction format, Michael Tokarev, 2023/05/23
- [Stable-7.2.3 33/45] tests/docker: bump the xtensa base to debian:11-slim, Michael Tokarev, 2023/05/23
- [Stable-7.2.3 34/45] linux-user: Fix mips fp64 executables loading, Michael Tokarev, 2023/05/23
- [Stable-7.2.3 36/45] migration: Handle block device inactivation failures better, Michael Tokarev, 2023/05/23
- [Stable-7.2.3 37/45] migration: Minor control flow simplification, Michael Tokarev, 2023/05/23
- [Stable-7.2.3 38/45] migration: Attempt disk reactivation in more failure scenarios, Michael Tokarev, 2023/05/23
- [Stable-7.2.3 35/45] linux-user: fix getgroups/setgroups allocations, Michael Tokarev, 2023/05/23
- [Stable-7.2.3 40/45] scsi-generic: fix buffer overflow on block limits inquiry, Michael Tokarev, 2023/05/23
- [Stable-7.2.3 39/45] target/arm: Fix vd == vm overlap in sve_ldff1_z,
Michael Tokarev <=
- [Stable-7.2.3 41/45] target/i386: fix operand size for VCOMI/VUCOMI instructions, Michael Tokarev, 2023/05/23
- [Stable-7.2.3 42/45] target/i386: fix avx2 instructions vzeroall and vpermdq, Michael Tokarev, 2023/05/23
- [Stable-7.2.3 44/45] virtio-net: not enable vq reset feature unconditionally, Michael Tokarev, 2023/05/23
- [Stable-7.2.3 43/45] vhost: fix possible wrap in SVQ descriptor ring, Michael Tokarev, 2023/05/23
- [Stable-7.2.3 45/45] virtio-crypto: fix NULL pointer dereference in virtio_crypto_free_request, Michael Tokarev, 2023/05/23