Skip to contentSkip to conversation

target/arm: Don't set syndrome ISS for loads and stores with writeback

PATCH In review Peter Maydell 2 participants 2 messages Jul 15, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/arm: Don't set syndrome ISS for loads and stores with writeback

The architecture requires that for faults on loads and stores which do writeback, the syndrome information does not have the ISS instruction syndrome information (i.e. ISV is 0). We got this wrong for the load and store instructions covered by disas_ldst_reg_imm9(). Calculate iss_valid correctly so that if the insn is a writeback one it is false.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1057

---
Tested with RTH's test case attached to the bug report.

---
 target/arm/translate-a64.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
target/arm/translate-a64.c +3 -1
index b7b64f73584..163df8c6157 100644
@@ -3138,7 +3138,7 @@ static void disas_ldst_reg_imm9(DisasContext *s, uint32_t insn,
     bool is_store = false;
     bool is_extended = false;
     bool is_unpriv = (idx == 2);
-    bool iss_valid = !is_vector;
+    bool iss_valid;
     bool post_index;
     bool writeback;
     int memidx;
@@ -3191,6 +3191,8 @@ static void disas_ldst_reg_imm9(DisasContext *s, uint32_t insn,
         g_assert_not_reached();
     }
 
+    iss_valid = !is_vector && !writeback;
+
     if (rn == 31) {
         gen_check_sp_alignment(s);
     }
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Peter Maydell

The architecture requires that for faults on loads and stores which do writeback, the syndrome information does not have the ISS instruction syndrome information (i.e. ISV is 0). We got this wrong for the load and store instructions covered by disas_ldst_reg_imm9(). Calculate iss_valid correctly so that if the insn is a writeback one it is false.

Quoted 7 lines

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1057

---
Tested with RTH's test case attached to the bug report.

---
  target/arm/translate-a64.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

r~

Quoted 23 lines
target/arm/translate-a64.c +3 -1
index b7b64f73584..163df8c6157 100644
@@ -3138,7 +3138,7 @@ static void disas_ldst_reg_imm9(DisasContext *s, uint32_t insn,
      bool is_store = false;
      bool is_extended = false;
      bool is_unpriv = (idx == 2);
-    bool iss_valid = !is_vector;
+    bool iss_valid;
      bool post_index;
      bool writeback;
      int memidx;
@@ -3191,6 +3191,8 @@ static void disas_ldst_reg_imm9(DisasContext *s, uint32_t insn,
          g_assert_not_reached();
      }
 
+    iss_valid = !is_vector && !writeback;
+
      if (rn == 31) {
          gen_check_sp_alignment(s);
      }