[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 12/12] target/arm: Fix A64 LDRA immediate decode
|
From: |
Peter Maydell |
|
Subject: |
[PULL 12/12] target/arm: Fix A64 LDRA immediate decode |
|
Date: |
Mon, 6 Nov 2023 15:32:38 +0000 |
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
---
target/arm/tcg/translate.h | 5 +++++
target/arm/tcg/a64.decode | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/target/arm/tcg/translate.h b/target/arm/tcg/translate.h
index 9efe00cf6ca..3c3bb3431ad 100644
--- a/target/arm/tcg/translate.h
+++ b/target/arm/tcg/translate.h
@@ -205,6 +205,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;
diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode
index 0cf11470741..8a20dce3c8f 100644
--- a/target/arm/tcg/a64.decode
+++ b/target/arm/tcg/a64.decode
@@ -462,7 +462,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
--
2.34.1
- [PULL 03/12] hw/arm/virt: Report correct register sizes in ACPI DBG2/SPCR tables., (continued)
- [PULL 03/12] hw/arm/virt: Report correct register sizes in ACPI DBG2/SPCR tables., Peter Maydell, 2023/11/06
- [PULL 11/12] hw/arm/vexpress-a9: Remove useless mapping of RAM at address 0, Peter Maydell, 2023/11/06
- [PULL 04/12] tests/qtest/bios-tables-test: Update virt SPCR and DBG2 golden references, Peter Maydell, 2023/11/06
- [PULL 07/12] mc146818rtc: rtc_set_time(): initialize tm to zeroes, Peter Maydell, 2023/11/06
- [PULL 05/12] hw/i386/intel_iommu: vtd_slpte_nonzero_rsvd(): assert no overflow, Peter Maydell, 2023/11/06
- [PULL 06/12] util/filemonitor-inotify: qemu_file_monitor_watch(): assert no overflow, Peter Maydell, 2023/11/06
- [PULL 10/12] io/channel-socket: qio_channel_socket_flush(): improve msg validation, Peter Maydell, 2023/11/06
- [PULL 09/12] hw/core/loader: gunzip(): initialize z_stream, Peter Maydell, 2023/11/06
- [PULL 08/12] block/nvme: nvme_process_completion() fix bound for cid, Peter Maydell, 2023/11/06
- [PULL 02/12] tests/qtest/bios-tables-test: Allow changes to virt SPCR and DBG2, Peter Maydell, 2023/11/06
- [PULL 12/12] target/arm: Fix A64 LDRA immediate decode,
Peter Maydell <=
- Re: [PULL 00/12] target-arm queue, Stefan Hajnoczi, 2023/11/06