]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/arm: Fix handling of LDAPR/STLR with negative offset
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 16 Jul 2024 10:30:32 +0000 (11:30 +0100)
committerMichael Tokarev <mjt@tls.msk.ru>
Fri, 19 Jul 2024 16:50:25 +0000 (19:50 +0300)
commitc68b380b629ca923252f8946ff0addfb4fc94925
tree42befc8942c8e94af2d6cab36bfe4a2691d2c352
parentab32beaa8e17de1731be2a7950a3da3a629ff43c
target/arm: Fix handling of LDAPR/STLR with negative offset

When we converted the LDAPR/STLR instructions to decodetree we
accidentally introduced a regression where the offset is negative.
The 9-bit immediate field is signed, and the old hand decoder
correctly used sextract32() to get it out of the insn word,
but the ldapr_stlr_i pattern in the decode file used "imm:9"
instead of "imm:s9", so it treated the field as unsigned.

Fix the pattern to treat the field as a signed immediate.

Cc: qemu-stable@nongnu.org
Fixes: 2521b6073b7 ("target/arm: Convert LDAPR/STLR (imm) to decodetree")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2419
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20240709134504.3500007-2-peter.maydell@linaro.org
(cherry picked from commit 5669d26ec614b3f4c56cf1489b9095ed327938b1)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
target/arm/tcg/a64.decode