Skip to contentSkip to conversation

Two quick tcg-ish fixes

PATCH In review Richard Henderson 2 participants 4 messages Jul 28, 2017

lore
Share & tools
lore
#0 lore raw

cover Two quick tcg-ish fixes

One found by Coverity and one found while working on some code destined for 2.11.

r~

Richard Henderson (2):
tcg/arm: Fix runtime overalignment test
target/s390x: Fix CSST for 16-byte store

 target/s390x/mem_helper.c | 1 +
 tcg/arm/tcg-target.inc.c  | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
Signature · 1 line
2.13.3
#1 lore raw

PATCH 1/2 tcg/arm: Fix runtime overalignment test

Patch 85aa80813dd changed the IF emitting the TST instruction, but failed to change the ?: converting CMP to CMPEQ, so the result of the TST is ignored.

---
 tcg/arm/tcg-target.inc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tcg/arm/tcg-target.inc.c +1 -1
index d1793ec77d..37efcf06af 100644
@@ -1223,7 +1223,7 @@ static TCGReg tcg_out_tlb_read(TCGContext *s, TCGReg addrlo, TCGReg addrhi,
     /* Load the tlb addend.  */
     tcg_out_ld32_12(s, COND_AL, TCG_REG_R2, TCG_REG_R2, add_off);
 
-    tcg_out_dat_reg(s, (s_bits ? COND_EQ : COND_AL), ARITH_CMP, 0,
+    tcg_out_dat_reg(s, (a_bits ? COND_EQ : COND_AL), ARITH_CMP, 0,
                     TCG_REG_R0, TCG_REG_TMP, SHIFT_IMM_LSL(TARGET_PAGE_BITS));
 
     if (TARGET_LONG_BITS == 64) {
Signature · 1 line
2.13.3
#2 lore raw

PATCH 2/2 target/s390x: Fix CSST for 16-byte store

In reply to Richard Henderson

Found by Coverity.

---
 target/s390x/mem_helper.c | 1 +
 1 file changed, 1 insertion(+)
target/s390x/mem_helper.c +1 -0
index cdc78aa3d4..c71dce4b1e 100644
@@ -1580,6 +1580,7 @@ uint32_t HELPER(csst)(CPUS390XState *env, uint32_t r3, uint64_t a1, uint64_t a2)
                 cpu_stq_data_ra(env, a2 + 0, svh, ra);
                 cpu_stq_data_ra(env, a2 + 8, svl, ra);
             }
+            break;
         default:
             g_assert_not_reached();
         }
Signature · 1 line
2.13.3
Reviewed-by on v1 2/2
#3 lore raw

Re: [Qemu-devel] [PATCH for-2.10 2/2] target/s390x: Fix CSST for 16-byte store

Quoted 1 line · Richard Henderson

Found by Coverity.

"Found by Coverity (CID 1378273)."

Quoted 2 lines
Quoted 17 lines
---
  target/s390x/mem_helper.c | 1 +
  1 file changed, 1 insertion(+)
target/s390x/mem_helper.c +1 -0
index cdc78aa3d4..c71dce4b1e 100644
@@ -1580,6 +1580,7 @@ uint32_t HELPER(csst)(CPUS390XState *env, uint32_t r3, uint64_t a1, uint64_t a2)
                  cpu_stq_data_ra(env, a2 + 0, svh, ra);
                  cpu_stq_data_ra(env, a2 + 8, svl, ra);
              }
+            break;
          default:
              g_assert_not_reached();
          }