Skip to contentSkip to conversation

target/arm: Amend erroneous BRAA/BLRAA opcode check

PATCH In review Mathew Maidment 2 participants 3 messages Jan 30, 2019 – Jan 31, 2019

lore
Share & tools
lore
#0 lore raw

cover target/arm: Amend erroneous BRAA/BLRAA opcode check

Hi,

This is a patch that fixes a condition within disas_uncond_b_reg() related to BRAA and BLRAA that would always result in the unallocated encoding path being taken.

Hopefully everything is in order. This is only my second patch, so if anything is wrong, that's my bad.

Thanks in advance for reviewing =)

Mathew Maidment (1):
target/arm: Amend erroneous BRAA/BLRAA opcode check

 target/arm/translate-a64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.17.2 (Apple Git-113)
#1 lore raw

PATCH 1/1 target/arm: Amend erroneous BRAA/BLRAA opcode check

Amends a small logical mistake that would always result in the branch to do_unallocated being taken.

---
 target/arm/translate-a64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/arm/translate-a64.c +1 -1
index 4d28a27c3b..350deae32b 100644
@@ -2036,7 +2036,7 @@ static void disas_uncond_b_reg(DisasContext *s, uint32_t insn)
         if (!dc_isar_feature(aa64_pauth, s)) {
             goto do_unallocated;
         }
-        if (op3 != 2 || op3 != 3) {
+        if (op3 != 2 && op3 != 3) {
             goto do_unallocated;
         }
         if (s->pauth_active) {
Signature · 1 line
2.17.2 (Apple Git-113)
#2 lore raw
In reply to Mathew Maidment
Quoted 8 lines · Mathew Maidment

This is a patch that fixes a condition within disas_uncond_b_reg() related to BRAA and BLRAA that would always result in the unallocated encoding path being taken.

Hopefully everything is in order. This is only my second patch, so if anything is wrong, that's my bad.

Thanks in advance for reviewing =)

Hi -- thanks for this patch. I think this bug is already covered by this patch that went onto the mailing list last week:
https://lists.gnu.org/archive/html/qemu-devel/2019-01/msg06728.html
-- you might like to test that series.

thanks
-- PMM