Skip to contentSkip to conversation

s390 patch queue 2015-07-07

GIT PULL Applied Alexander Graf 2 participants 6 messages Jul 7, 2015 – Jul 8, 2015

lore
Share & tools
lore
#0 lore raw

Hi Peter,

This is my current patch queue for s390. Please pull.

Alex

The following changes since commit aeb72188e073d515e1f5a80f6b603692a396477b:

Merge remote-tracking branch 'remotes/kraxel/tags/pull-vga-20150707-1' into staging (2015-07-07 14:44:19 +0100)

are available in the git repository at:

git://github.com/agraf/qemu.git tags/signed-s390-for-upstream

for you to fetch changes up to cd3b29b745b0ff393b2d37317837bc726b8dacc8:

tcg/s390: fix branch target change during code retranslation (2015-07-07 17:51:47 +0200)

----------------------------------------------------------------
Patch queue for s390 - 2015-07-07

A few last minute fixes for 2.4. All of them are s390 TCG bug fixes.

----------------------------------------------------------------
Aurelien Jarno (4):

      target-s390x: fix MOVE LONG instruction
      target-s390x: fix EXECUTE instruction executing TRT
      target-s390x: fix CONVERT TO BINARY (CVD, CVDY)
      tcg/s390: fix branch target change during code retranslation
 target-s390x/int_helper.c |  9 ++++-----
 target-s390x/mem_helper.c |  3 ++-
 tcg/s390/tcg-target.c     | 12 ++++++++----
 3 files changed, 14 insertions(+), 10 deletions(-)
#1 lore raw

[Qemu-devel] [PULL 1/4] target-s390x: fix MOVE LONG instruction

From: Aurelien Jarno <[email protected]>

The MOVE LONG instruction should pad the destination operand with the byte from bit positions 32-39 of the source length (r2 + 1), not with the same byte in the source address.

---
 target-s390x/mem_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target-s390x/mem_helper.c +1 -1
index 3ccbeb9..9f0eb1e 100644
@@ -550,7 +550,7 @@ uint32_t HELPER(mvcl)(CPUS390XState *env, uint32_t r1, uint32_t r2)
     uint64_t dest = get_address_31fix(env, r1);
     uint64_t srclen = env->regs[r2 + 1] & 0xffffff;
     uint64_t src = get_address_31fix(env, r2);
-    uint8_t pad = src >> 24;
+    uint8_t pad = env->regs[r2 + 1] >> 24;
     uint8_t v;
     uint32_t cc;
 
Signature · 1 line
1.7.12.4
#2 lore raw

[Qemu-devel] [PULL 2/4] target-s390x: fix EXECUTE instruction executing TRT

In reply to Alexander Graf

From: Aurelien Jarno <[email protected]>

A break is missing in the EXECUTE instruction, when executing the TRANSLATE AND TEST instruction.

---
 target-s390x/mem_helper.c | 1 +
 1 file changed, 1 insertion(+)
target-s390x/mem_helper.c +1 -0
index 9f0eb1e..6f8bd79 100644
@@ -482,6 +482,7 @@ uint32_t HELPER(ex)(CPUS390XState *env, uint32_t cc, uint64_t v1,
         case 0xc00:
             helper_tr(env, l, get_address(env, 0, b1, d1),
                       get_address(env, 0, b2, d2));
+            break;
         case 0xd00:
             cc = helper_trt(env, l, get_address(env, 0, b1, d1),
                             get_address(env, 0, b2, d2));
Signature · 1 line
1.7.12.4
#3 lore raw

[Qemu-devel] [PULL 3/4] target-s390x: fix CONVERT TO BINARY (CVD, CVDY)

In reply to Alexander Graf

From: Aurelien Jarno <[email protected]>

current_number being shift left by more than 32 bits, we can't use a simple int. Similarly use an int64_t type for the input binary value, to not get the -2^31 case wrong. Finally don't initialize shift to 4, it's already done in the for loop.

---
 target-s390x/int_helper.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
target-s390x/int_helper.c +4 -5
index 2c2b3f6..a46c736 100644
@@ -121,11 +121,12 @@ uint64_t HELPER(clz)(uint64_t v)
     return clz64(v);
 }
 
-uint64_t HELPER(cvd)(int32_t bin)
+uint64_t HELPER(cvd)(int32_t reg)
 {
     /* positive 0 */
     uint64_t dec = 0x0c;
-    int shift = 4;
+    int64_t bin = reg;
+    int shift;
 
     if (bin < 0) {
         bin = -bin;
@@ -133,9 +134,7 @@ uint64_t HELPER(cvd)(int32_t bin)
     }
 
     for (shift = 4; (shift < 64) && bin; shift += 4) {
-        int current_number = bin % 10;
-
-        dec |= (current_number) << shift;
+        dec |= (bin % 10) << shift;
         bin /= 10;
     }
 
Signature · 1 line
1.7.12.4
#4 lore raw

[Qemu-devel] [PULL 4/4] tcg/s390: fix branch target change during code retranslation

In reply to Alexander Graf

From: Aurelien Jarno <[email protected]>

Make sure to not modify the branch target. This ensure that the branch target is not corrupted during partial retranslation.

---
 tcg/s390/tcg-target.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
tcg/s390/tcg-target.c +8 -4
index 669fafe..921991e 100644
@@ -1643,8 +1643,10 @@ static void tcg_out_qemu_ld(TCGContext* s, TCGReg data_reg, TCGReg addr_reg,
 
     base_reg = tcg_out_tlb_read(s, addr_reg, opc, mem_index, 1);
 
-    label_ptr = s->code_ptr + 1;
-    tcg_out_insn(s, RI, BRC, S390_CC_NE, 0);
+    /* We need to keep the offset unchanged for retranslation.  */
+    tcg_out16(s, RI_BRC | (S390_CC_NE << 4));
+    label_ptr = s->code_ptr;
+    s->code_ptr += 1;
 
     tcg_out_qemu_ld_direct(s, opc, data_reg, base_reg, TCG_REG_R2, 0);
 
@@ -1669,8 +1671,10 @@ static void tcg_out_qemu_st(TCGContext* s, TCGReg data_reg, TCGReg addr_reg,
 
     base_reg = tcg_out_tlb_read(s, addr_reg, opc, mem_index, 0);
 
-    label_ptr = s->code_ptr + 1;
-    tcg_out_insn(s, RI, BRC, S390_CC_NE, 0);
+    /* We need to keep the offset unchanged for retranslation.  */
+    tcg_out16(s, RI_BRC | (S390_CC_NE << 4));
+    label_ptr = s->code_ptr;
+    s->code_ptr += 1;
 
     tcg_out_qemu_st_direct(s, opc, data_reg, base_reg, TCG_REG_R2, 0);
 
Signature · 1 line
1.7.12.4
#5 lore raw
In reply to Alexander Graf
Quoted 18 lines · Alexander Graf

Hi Peter,

This is my current patch queue for s390. Please pull.

Alex

The following changes since commit aeb72188e073d515e1f5a80f6b603692a396477b:

Merge remote-tracking branch 'remotes/kraxel/tags/pull-vga-20150707-1' into staging (2015-07-07 14:44:19 +0100)

are available in the git repository at:

git://github.com/agraf/qemu.git tags/signed-s390-for-upstream

for you to fetch changes up to cd3b29b745b0ff393b2d37317837bc726b8dacc8:

Quoted 8 lines

tcg/s390: fix branch target change during code retranslation (2015-07-07 17:51:47 +0200)

----------------------------------------------------------------
Patch queue for s390 - 2015-07-07

A few last minute fixes for 2.4. All of them are s390 TCG bug fixes.

----------------------------------------------------------------

Applied, thanks.

-- PMM