[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-8.1.3 39/55] target/arm: Fix A64 LDRA immediate decode
From: |
Michael Tokarev |
Subject: |
[Stable-8.1.3 39/55] target/arm: Fix A64 LDRA immediate decode |
Date: |
Thu, 9 Nov 2023 16:42:43 +0300 |
From: Peter Maydell <peter.maydell@linaro.org>
In commit be23a049 in the conversion to decodetree we broke the
decoding of the immediate value in the LDRA instruction. This should
be a 10 bit signed value that is scaled by 8, but in the conversion
we incorrectly ended up scaling it only by 2. Fix the scaling
factor.
Cc: qemu-stable@nongnu.org
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1970
Fixes: be23a049 ("target/arm: Convert load (pointer auth) insns to decodetree")
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20231106113445.1163063-1-peter.maydell@linaro.org
(cherry picked from commit 5722fc471296d5f042df4b005a851cc8008df0c9)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode
index ef64a3f9cb..7e09fd18b4 100644
--- a/target/arm/tcg/a64.decode
+++ b/target/arm/tcg/a64.decode
@@ -461,7 +461,7 @@ LDAPR sz:2 111 0 00 1 0 1 11111 1100 00 rn:5 rt:5
# Load/store register (pointer authentication)
# LDRA immediate is 10 bits signed and scaled, but the bits aren't all
contiguous
-%ldra_imm 22:s1 12:9 !function=times_2
+%ldra_imm 22:s1 12:9 !function=times_8
LDRA 11 111 0 00 m:1 . 1 ......... w:1 1 rn:5 rt:5 imm=%ldra_imm
diff --git a/target/arm/tcg/translate.h b/target/arm/tcg/translate.h
index d1cacff0b2..1afcd16ab1 100644
--- a/target/arm/tcg/translate.h
+++ b/target/arm/tcg/translate.h
@@ -203,6 +203,11 @@ static inline int times_4(DisasContext *s, int x)
return x * 4;
}
+static inline int times_8(DisasContext *s, int x)
+{
+ return x * 8;
+}
+
static inline int times_2_plus_1(DisasContext *s, int x)
{
return x * 2 + 1;
--
2.39.2
- [Stable-8.1.3 26/55] target/arm: Correctly propagate stage 1 BTI guarded bit in a two-stage walk, (continued)
- [Stable-8.1.3 26/55] target/arm: Correctly propagate stage 1 BTI guarded bit in a two-stage walk, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 28/55] vfio/pci: Fix buffer overrun when writing the VF token, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 27/55] util/uuid: Add UUID_STR_LEN definition, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 29/55] util/uuid: Remove UUID_FMT_LEN, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 30/55] i386/xen: Don't advertise XENFEAT_supervisor_mode_kernel, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 35/55] hw/xen: take iothread mutex in xen_evtchn_reset_op(), Michael Tokarev, 2023/11/09
- [Stable-8.1.3 32/55] hw/xen: select kernel mode for per-vCPU event channel upcall vector, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 31/55] i386/xen: fix per-vCPU upcall vector for Xen emulation, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 33/55] hw/xen: don't clear map_track[] in xen_gnttab_reset(), Michael Tokarev, 2023/11/09
- [Stable-8.1.3 34/55] hw/xen: fix XenStore watch delivery to guest, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 39/55] target/arm: Fix A64 LDRA immediate decode,
Michael Tokarev <=
- [Stable-8.1.3 36/55] hw/xen: use correct default protocol for xen-block on x86, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 37/55] virtio-gpu: block migration of VMs with blob=true, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 38/55] block/nvme: nvme_process_completion() fix bound for cid, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 41/55] block/file-posix: fix update_zones_wp() caller, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 45/55] ui/gtk-egl: apply scale factor when calculating window's dimension, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 40/55] qcow2: keep reference on zeroize with discard-no-unref enabled, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 42/55] file-posix: fix over-writing of returning zone_append offset, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 43/55] ati-vga: Implement fallback for pixman routines, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 44/55] ui/gtk: force realization of drawing area, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 46/55] ui/gtk-egl: Check EGLSurface before doing scanout, Michael Tokarev, 2023/11/09