Skip to contentSkip to conversation

Queued s390 patches

GIT PULL Applied Richard Henderson 2 participants 11 messages May 12, 2017 – May 15, 2017

lore
Share & tools
lore
#0 lore raw

This is a combination of my queued patches and those posted by Aurelien this week.

r~

The following changes since commit ecc1f5adeec4e3324d1b695a7c54e3967c526949:

maintainers: Add myself as linux-user reviewer (2017-05-11 13:31:11 -0400)

are available in the git repository at:

git://github.com/rth7680/qemu.git tags/pull-s390-20170512

for you to fetch changes up to 538fad597d898f677f81cb4daacd37e7cdc18e6e:

target/s390x: implement serialization in BRANCH CONDITION (2017-05-12 15:48:41 -0700)

----------------------------------------------------------------
Queued target/s390 patches

----------------------------------------------------------------
Aurelien Jarno (3):

      target/s390x: mask the SIGP order_code using SIGP_ORDER_MASK
      target/s390x: fix SIGNAL PROCESSOR return value
      target/s390x: implement serialization in BRANCH CONDITION

Eric Bischoff (1):

      target/s390x: Implement LOAD PAIR DISJOINT

Miroslav Benes (1):

      target/s390x: Implement LOAD PROGRAM PARAMETER

Richard Henderson (4):

      target/s390x: Implement STORE FACILITIES LIST EXTENDED
      target/s390x: Diagnose specification exception for atomics
      target/s390x: Use atomic operations for COMPARE SWAP
      target/s390x: Use atomic operations for LOAD AND OP
 target/s390x/cpu.c         |   1 +
 target/s390x/cpu.h         |   6 ++
 target/s390x/helper.c      |  16 +++
 target/s390x/helper.h      |   3 +
 target/s390x/insn-data.def |  38 ++++---
 target/s390x/kvm.c         |   2 -
 target/s390x/mem_helper.c  |  40 ++++++++
 target/s390x/misc_helper.c |  62 +++++++++++-
 target/s390x/translate.c   | 245 ++++++++++++++++++++++++++-------------------
 9 files changed, 288 insertions(+), 125 deletions(-)
#1 lore raw

[Qemu-devel] [PULL 1/9] target/s390x: Implement STORE FACILITIES LIST EXTENDED

At the same time, improve STORE FACILITIES LIST
so that we don't hard-code the list for all cpus.

---
 target/s390x/helper.h      |  2 ++
 target/s390x/insn-data.def |  2 ++
 target/s390x/misc_helper.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++
 target/s390x/translate.c   | 17 ++++++-------
 4 files changed, 72 insertions(+), 8 deletions(-)
target/s390x/helper.h +2 -0
index 9102071..01adb50 100644
@@ -83,6 +83,8 @@ DEF_HELPER_FLAGS_5(calc_cc, TCG_CALL_NO_RWG_SE, i32, env, i32, i64, i64, i64)
 DEF_HELPER_FLAGS_2(sfpc, TCG_CALL_NO_RWG, void, env, i64)
 DEF_HELPER_FLAGS_2(sfas, TCG_CALL_NO_WG, void, env, i64)
 DEF_HELPER_FLAGS_1(popcnt, TCG_CALL_NO_RWG_SE, i64, i64)
+DEF_HELPER_FLAGS_1(stfl, TCG_CALL_NO_RWG, void, env)
+DEF_HELPER_2(stfle, i32, env, i64)
 
 #ifndef CONFIG_USER_ONLY
 DEF_HELPER_3(servc, i32, env, i64, i64)
target/s390x/insn-data.def +2 -0
index 075ff59..b6702da 100644
@@ -747,6 +747,8 @@
     C(0xe33e, STRV,    RXY_a, Z,   la2, r1_32u, new, m1_32, rev32, 0)
     C(0xe32f, STRVG,   RXY_a, Z,   la2, r1_o, new, m1_64, rev64, 0)
 
+/* STORE FACILITY LIST EXTENDED */
+    C(0xb2b0, STFLE,   S,  SFLE,   0, a2, 0, 0, stfle, 0)
 /* STORE FPC */
     C(0xb29c, STFPC,   S,     Z,   0, a2, new, m2_32, efpc, 0)
 
target/s390x/misc_helper.c +59 -0

62 lines not on this page · raw message

target/s390x/translate.c +9 -8
index 01c6217..69940e3 100644
@@ -3628,15 +3628,8 @@ static ExitStatus op_spt(DisasContext *s, DisasOps *o)
 
 static ExitStatus op_stfl(DisasContext *s, DisasOps *o)
 {
-    TCGv_i64 f, a;
-    /* We really ought to have more complete indication of facilities
-       that we implement.  Address this when STFLE is implemented.  */
     check_privileged(s);
-    f = tcg_const_i64(0xc0000000);
-    a = tcg_const_i64(200);
-    tcg_gen_qemu_st32(f, a, get_mem_index(s));
-    tcg_temp_free_i64(f);
-    tcg_temp_free_i64(a);
+    gen_helper_stfl(cpu_env);
     return NO_EXIT;
 }
 
@@ -3802,6 +3795,14 @@ static ExitStatus op_sturg(DisasContext *s, DisasOps *o)
 }
 #endif
 
+static ExitStatus op_stfle(DisasContext *s, DisasOps *o)
+{
+    potential_page_fault(s);
+    gen_helper_stfle(cc_op, cpu_env, o->in2);
+    set_cc_static(s);
+    return NO_EXIT;
+}
+
 static ExitStatus op_st8(DisasContext *s, DisasOps *o)
 {
     tcg_gen_qemu_st8(o->in1, o->in2, get_mem_index(s));
Signature · 1 line
2.9.3
#2 lore raw

[Qemu-devel] [PULL 2/9] target/s390x: Implement LOAD PROGRAM PARAMETER

In reply to Richard Henderson

From: Miroslav Benes <[email protected]>

Linux arch/s390/kernel/head(64).S uses LPP instruction if it is available in facilities list provided by stfl/stfle instruction. This is the case of newer z/System generations and their qemu definition.

The description of LPP is at
http://www-01.ibm.com/support/docview.wss?uid=isg26fcd1cc32246f4c8852574ce0044734a

Message-Id: <[email protected]>

---
 target/s390x/insn-data.def | 2 ++
 target/s390x/translate.c   | 9 +++++++++
 2 files changed, 11 insertions(+)
target/s390x/insn-data.def +2 -0
index b6702da..43c5707 100644
@@ -845,6 +845,8 @@
 /* LOAD CONTROL */
     C(0xb700, LCTL,    RS_a,  Z,   0, a2, 0, 0, lctl, 0)
     C(0xeb2f, LCTLG,   RSY_a, Z,   0, a2, 0, 0, lctlg, 0)
+/* LOAD PROGRAM PARAMETER */
+    C(0xb280, LPP,     S,   LPP,   0, m2_64, 0, 0, lpp, 0)
 /* LOAD PSW */
     C(0x8200, LPSW,    S,     Z,   0, a2, 0, 0, lpsw, 0)
 /* LOAD PSW EXTENDED */
target/s390x/translate.c +9 -0
index 69940e3..2b66a4e 100644
@@ -1194,6 +1194,7 @@ typedef enum DisasFacility {
     FAC_SCF,                /* store clock fast */
     FAC_SFLE,               /* store facility list extended */
     FAC_ILA,                /* interlocked access facility 1 */
+    FAC_LPP,                /* load-program-parameter */
 } DisasFacility;
 
 struct DisasInsn {
@@ -2567,6 +2568,14 @@ static ExitStatus op_lra(DisasContext *s, DisasOps *o)
     return NO_EXIT;
 }
 
+static ExitStatus op_lpp(DisasContext *s, DisasOps *o)
+{
+    check_privileged(s);
+
+    tcg_gen_st_i64(o->in2, cpu_env, offsetof(CPUS390XState, pp));
+    return NO_EXIT;
+}
+
 static ExitStatus op_lpsw(DisasContext *s, DisasOps *o)
 {
     TCGv_i64 t1, t2;
Signature · 1 line
2.9.3
#3 lore raw

[Qemu-devel] [PULL 3/9] target/s390x: Diagnose specification exception for atomics

In reply to Richard Henderson

All of the interlocked access facility instructions raise a specification exception for unaligned accesses. Do this by using the (previously unused) unaligned_access hook.

---
 target/s390x/cpu.c    |  1 +
 target/s390x/cpu.h    |  3 +++
 target/s390x/helper.c | 16 ++++++++++++++++
 3 files changed, 20 insertions(+)
target/s390x/cpu.c +1 -0
index 066dcd1..a1bf2ba 100644
@@ -430,6 +430,7 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data)
     cc->write_elf64_note = s390_cpu_write_elf64_note;
     cc->cpu_exec_interrupt = s390_cpu_exec_interrupt;
     cc->debug_excp_handler = s390x_cpu_debug_excp_handler;
+    cc->do_unaligned_access = s390x_cpu_do_unaligned_access;
 #endif
     cc->disas_set_info = s390_cpu_disas_set_info;
 
target/s390x/cpu.h +3 -0
index 058ddad..bbed320 100644
@@ -480,6 +480,9 @@ int s390_cpu_handle_mmu_fault(CPUState *cpu, vaddr address, int rw,
 
 #ifndef CONFIG_USER_ONLY
 void do_restart_interrupt(CPUS390XState *env);
+void s390x_cpu_do_unaligned_access(CPUState *cs, vaddr addr,
+                                   MMUAccessType access_type,
+                                   int mmu_idx, uintptr_t retaddr);
 
 static inline hwaddr decode_basedisp_s(CPUS390XState *env, uint32_t ipb,
                                        uint8_t *ar)
target/s390x/helper.c +16 -0
index 68bd2f9..9978490 100644
@@ -718,4 +718,20 @@ void s390x_cpu_debug_excp_handler(CPUState *cs)
         cpu_loop_exit_noexc(cs);
     }
 }
+
+/* Unaligned accesses are only diagnosed with MO_ALIGN.  At the moment,
+   this is only for the atomic operations, for which we want to raise a
+   specification exception.  */
+void s390x_cpu_do_unaligned_access(CPUState *cs, vaddr addr,
+                                   MMUAccessType access_type,
+                                   int mmu_idx, uintptr_t retaddr)
+{
+    S390CPU *cpu = S390_CPU(cs);
+    CPUS390XState *env = &cpu->env;
+
+    if (retaddr) {
+        cpu_restore_state(cs, retaddr);
+    }
+    program_interrupt(env, PGM_SPECIFICATION, ILEN_LATER);
+}
 #endif /* CONFIG_USER_ONLY */
Signature · 1 line
2.9.3
#4 lore raw

[Qemu-devel] [PULL 4/9] target/s390x: Implement LOAD PAIR DISJOINT

In reply to Richard Henderson

From: Eric Bischoff <[email protected]>

Message-Id: <[email protected]>

[rth: Combine the two via insn->data; free the address temps.]
---
 target/s390x/insn-data.def |  4 +++-
 target/s390x/translate.c   | 42 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 45 insertions(+), 1 deletion(-)
target/s390x/insn-data.def +3 -1
index 43c5707..0909060 100644
@@ -504,7 +504,9 @@
     C(0xb9e2, LOCGR,   RRF_c, LOC, r1, r2, r1, 0, loc, 0)
     C(0xebf2, LOC,     RSY_b, LOC, r1, m2_32u, new, r1_32, loc, 0)
     C(0xebe2, LOCG,    RSY_b, LOC, r1, m2_64, r1, 0, loc, 0)
-/* LOAD PAIR DISJOINT TODO */
+/* LOAD PAIR DISJOINT */
+    D(0xc804, LPD,     SSF,   ILA, 0, 0, new_P, r3_P32, lpd, 0, MO_TEUL)
+    D(0xc805, LPDG,    SSF,   ILA, 0, 0, new_P, r3_P64, lpd, 0, MO_TEQ)
 /* LOAD POSITIVE */
     C(0x1000, LPR,     RR_a,  Z,   0, r2_32s, new, r1_32, abs, abs32)
     C(0xb900, LPGR,    RRE,   Z,   0, r2, r1, 0, abs, abs64)
target/s390x/translate.c +42 -0

60 lines not on this page · raw message

Signature · 1 line
2.9.3
#5 lore raw

[Qemu-devel] [PULL 5/9] target/s390x: Use atomic operations for COMPARE SWAP

In reply to Richard Henderson
---
 target/s390x/helper.h      |  1 +
 target/s390x/insn-data.def | 10 +++---
 target/s390x/mem_helper.c  | 40 ++++++++++++++++++++++
 target/s390x/translate.c   | 83 ++++++++--------------------------------------
 4 files changed, 60 insertions(+), 74 deletions(-)
target/s390x/helper.h +1 -0
index 01adb50..0b70770 100644
@@ -25,6 +25,7 @@ DEF_HELPER_3(cxgb, i64, env, s64, i32)
 DEF_HELPER_3(celgb, i64, env, i64, i32)
 DEF_HELPER_3(cdlgb, i64, env, i64, i32)
 DEF_HELPER_3(cxlgb, i64, env, i64, i32)
+DEF_HELPER_4(cdsg, void, env, i64, i32, i32)
 DEF_HELPER_FLAGS_3(aeb, TCG_CALL_NO_WG, i64, env, i64, i64)
 DEF_HELPER_FLAGS_3(adb, TCG_CALL_NO_WG, i64, env, i64, i64)
 DEF_HELPER_FLAGS_5(axb, TCG_CALL_NO_WG, i64, env, i64, i64, i64, i64)
target/s390x/insn-data.def +5 -5
index 0909060..5e5fcc5 100644
@@ -239,12 +239,12 @@
     D(0xec7d, CLGIJ,   RIE_c, GIE, r1_o, i2_8u, 0, 0, cj, 0, 1)
 
 /* COMPARE AND SWAP */
-    D(0xba00, CS,      RS_a,  Z,   r3_32u, r1_32u, new, r1_32, cs, 0, 0)
-    D(0xeb14, CSY,     RSY_a, LD,  r3_32u, r1_32u, new, r1_32, cs, 0, 0)
-    D(0xeb30, CSG,     RSY_a, Z,   r3_o, r1_o, new, r1, cs, 0, 1)
+    D(0xba00, CS,      RS_a,  Z,   r3_32u, r1_32u, new, r1_32, cs, 0, MO_TEUL)
+    D(0xeb14, CSY,     RSY_a, LD,  r3_32u, r1_32u, new, r1_32, cs, 0, MO_TEUL)
+    D(0xeb30, CSG,     RSY_a, Z,   r3_o, r1_o, new, r1, cs, 0, MO_TEQ)
 /* COMPARE DOUBLE AND SWAP */
-    D(0xbb00, CDS,     RS_a,  Z,   r3_D32, r1_D32, new, r1_D32, cs, 0, 1)
-    D(0xeb31, CDSY,    RSY_a, LD,  r3_D32, r1_D32, new, r1_D32, cs, 0, 1)
+    D(0xbb00, CDS,     RS_a,  Z,   r3_D32, r1_D32, new, r1_D32, cs, 0, MO_TEQ)
+    D(0xeb31, CDSY,    RSY_a, LD,  r3_D32, r1_D32, new, r1_D32, cs, 0, MO_TEQ)
     C(0xeb3e, CDSG,    RSY_a, Z,   0, 0, 0, 0, cdsg, 0)
 
 /* COMPARE AND TRAP */
target/s390x/mem_helper.c +40 -0
index 675aba2..f6e5bce 100644
@@ -23,6 +23,7 @@
 #include "exec/helper-proto.h"
 #include "exec/exec-all.h"
 #include "exec/cpu_ldst.h"
+#include "qemu/int128.h"
 
 #if !defined(CONFIG_USER_ONLY)
 #include "hw/s390x/storage-keys.h"
@@ -844,6 +845,45 @@ uint32_t HELPER(trt)(CPUS390XState *env, uint32_t len, uint64_t array,
     return cc;
 }
 
+void HELPER(cdsg)(CPUS390XState *env, uint64_t addr,
+                  uint32_t r1, uint32_t r3)
+{
+    uintptr_t ra = GETPC();
+    Int128 cmpv = int128_make128(env->regs[r1 + 1], env->regs[r1]);
+    Int128 newv = int128_make128(env->regs[r3 + 1], env->regs[r3]);
+    Int128 oldv;
+    bool fail;
+
+    if (parallel_cpus) {
+#ifndef CONFIG_ATOMIC128
+        cpu_loop_exit_atomic(ENV_GET_CPU(env), ra);
+#else
+        int mem_idx = cpu_mmu_index(env, false);
+        TCGMemOpIdx oi = make_memop_idx(MO_TEQ | MO_ALIGN_16, mem_idx);
+        oldv = helper_atomic_cmpxchgo_be_mmu(env, addr, cmpv, newv, oi, ra);
+        fail = !int128_eq(oldv, cmpv);
+#endif
+    } else {
+        uint64_t oldh, oldl;
+
+        oldh = cpu_ldq_data_ra(env, addr + 0, ra);
+        oldl = cpu_ldq_data_ra(env, addr + 8, ra);
+
+        oldv = int128_make128(oldl, oldh);
+        fail = !int128_eq(oldv, cmpv);
+        if (fail) {
+            newv = oldv;
+        }
+
+        cpu_stq_data_ra(env, addr + 0, int128_gethi(newv), ra);
+        cpu_stq_data_ra(env, addr + 8, int128_getlo(newv), ra);
+    }
+
+    env->cc_op = fail;
+    env->regs[r1] = int128_gethi(oldv);
+    env->regs[r1 + 1] = int128_getlo(oldv);
+}
+
 #if !defined(CONFIG_USER_ONLY)
 void HELPER(lctlg)(CPUS390XState *env, uint32_t r1, uint64_t a2, uint32_t r3)
 {
target/s390x/translate.c +14 -69

116 lines not on this page · raw message

Signature · 1 line
2.9.3
#6 lore raw

[Qemu-devel] [PULL 6/9] target/s390x: Use atomic operations for LOAD AND OP

In reply to Richard Henderson
---
 target/s390x/insn-data.def | 20 ++++++------
 target/s390x/translate.c   | 78 +++++++++++++++++++++++++++++-----------------
 2 files changed, 60 insertions(+), 38 deletions(-)
target/s390x/insn-data.def +10 -10
index 5e5fcc5..55a7c52 100644
@@ -390,20 +390,20 @@
 /* LOAD ADDRESS RELATIVE LONG */
     C(0xc000, LARL,    RIL_b, Z,   0, ri2, 0, r1, mov2, 0)
 /* LOAD AND ADD */
-    C(0xebf8, LAA,     RSY_a, ILA, r3_32s, m2_32s_atomic, new, m2_32_r1_atomic, add, adds32)
-    C(0xebe8, LAAG,    RSY_a, ILA, r3, m2_64_atomic, new, m2_64_r1_atomic, add, adds64)
+    D(0xebf8, LAA,     RSY_a, ILA, r3_32s, a2, new, in2_r1_32, laa, adds32, MO_TESL)
+    D(0xebe8, LAAG,    RSY_a, ILA, r3, a2, new, in2_r1, laa, adds64, MO_TEQ)
 /* LOAD AND ADD LOGICAL */
-    C(0xebfa, LAAL,    RSY_a, ILA, r3_32s, m2_32s_atomic, new, m2_32_r1_atomic, add, addu32)
-    C(0xebea, LAALG,   RSY_a, ILA, r3, m2_64_atomic, new, m2_64_r1_atomic, add, addu64)
+    D(0xebfa, LAAL,    RSY_a, ILA, r3_32u, a2, new, in2_r1_32, laa, addu32, MO_TEUL)
+    D(0xebea, LAALG,   RSY_a, ILA, r3, a2, new, in2_r1, laa, addu64, MO_TEQ)
 /* LOAD AND AND */
-    C(0xebf4, LAN,     RSY_a, ILA, r3_32s, m2_32s_atomic, new, m2_32_r1_atomic, and, nz32)
-    C(0xebe4, LANG,    RSY_a, ILA, r3, m2_64_atomic, new, m2_64_r1_atomic, and, nz64)
+    D(0xebf4, LAN,     RSY_a, ILA, r3_32s, a2, new, in2_r1_32, lan, nz32, MO_TESL)
+    D(0xebe4, LANG,    RSY_a, ILA, r3, a2, new, in2_r1, lan, nz64, MO_TEQ)
 /* LOAD AND EXCLUSIVE OR */
-    C(0xebf7, LAX,     RSY_a, ILA, r3_32s, m2_32s_atomic, new, m2_32_r1_atomic, xor, nz32)
-    C(0xebe7, LAXG,    RSY_a, ILA, r3, m2_64_atomic, new, m2_64_r1_atomic, xor, nz64)
+    D(0xebf7, LAX,     RSY_a, ILA, r3_32s, a2, new, in2_r1_32, lax, nz32, MO_TESL)
+    D(0xebe7, LAXG,    RSY_a, ILA, r3, a2, new, in2_r1, lax, nz64, MO_TEQ)
 /* LOAD AND OR */
-    C(0xebf6, LAO,     RSY_a, ILA, r3_32s, m2_32s_atomic, new, m2_32_r1_atomic, or, nz32)
-    C(0xebe6, LAOG,    RSY_a, ILA, r3, m2_64_atomic, new, m2_64_r1_atomic, or, nz64)
+    D(0xebf6, LAO,     RSY_a, ILA, r3_32s, a2, new, in2_r1_32, lao, nz32, MO_TESL)
+    D(0xebe6, LAOG,    RSY_a, ILA, r3, a2, new, in2_r1, lao, nz64, MO_TEQ)
 /* LOAD AND TEST */
     C(0x1200, LTR,     RR_a,  Z,   0, r2_o, 0, cond_r1r2_32, mov2, s32)
     C(0xb902, LTGR,    RRE,   Z,   0, r2_o, 0, r1, mov2, s64)
target/s390x/translate.c +50 -28

101 lines not on this page · raw message

Signature · 1 line
2.9.3
#7 lore raw

[Qemu-devel] [PULL 7/9] target/s390x: mask the SIGP order_code using SIGP_ORDER_MASK

In reply to Richard Henderson

From: Aurelien Jarno <[email protected]>

For that move the definition from kvm.c to cpu.h

Message-Id: <[email protected]>

---
 target/s390x/cpu.h         | 3 +++
 target/s390x/kvm.c         | 2 --
 target/s390x/misc_helper.c | 3 +--
 3 files changed, 4 insertions(+), 4 deletions(-)
target/s390x/cpu.h +3 -0
index bbed320..240b8a5 100644
@@ -1078,6 +1078,9 @@ struct sysib_322 {
 #define SIGP_MODE_Z_ARCH_TRANS_ALL_PSW 1
 #define SIGP_MODE_Z_ARCH_TRANS_CUR_PSW 2
 
+/* SIGP order code mask corresponding to bit positions 56-63 */
+#define SIGP_ORDER_MASK 0x000000ff
+
 void load_psw(CPUS390XState *env, uint64_t mask, uint64_t addr);
 int mmu_translate(CPUS390XState *env, target_ulong vaddr, int rw, uint64_t asc,
                   target_ulong *raddr, int *flags, bool exc);
target/s390x/kvm.c +0 -2
index 1a249d8..fb10542 100644
@@ -1764,8 +1764,6 @@ static int sigp_set_architecture(S390CPU *cpu, uint32_t param,
     return SIGP_CC_ORDER_CODE_ACCEPTED;
 }
 
-#define SIGP_ORDER_MASK 0x000000ff
-
 static int handle_sigp(S390CPU *cpu, struct kvm_run *run, uint8_t ipa1)
 {
     CPUS390XState *env = &cpu->env;
target/s390x/misc_helper.c +1 -2
index bd94242..23ec52c 100644
@@ -517,8 +517,7 @@ uint32_t HELPER(sigp)(CPUS390XState *env, uint64_t order_code, uint32_t r1,
     /* Remember: Use "R1 or R1 + 1, whichever is the odd-numbered register"
        as parameter (input). Status (output) is always R1. */
 
-    /* sigp contains the order code in bit positions 56-63, mask it here. */
-    switch (order_code & 0xff) {
+    switch (order_code & SIGP_ORDER_MASK) {
     case SIGP_SET_ARCH:
         /* switch arch */
         break;
Signature · 1 line
2.9.3
#8 lore raw

[Qemu-devel] [PULL 8/9] target/s390x: fix SIGNAL PROCESSOR return value

In reply to Richard Henderson

From: Aurelien Jarno <[email protected]>

The SIGNAL PROCESSOR helper returns its value through the CC register. set_cc_static should be called just after the helper.

Message-Id: <[email protected]>

---
 target/s390x/translate.c | 1 +
 1 file changed, 1 insertion(+)
target/s390x/translate.c +1 -0
index 19276cc..3a0a3ee 100644
@@ -3406,6 +3406,7 @@ static ExitStatus op_sigp(DisasContext *s, DisasOps *o)
     check_privileged(s);
     potential_page_fault(s);
     gen_helper_sigp(cc_op, cpu_env, o->in2, r1, o->in1);
+    set_cc_static(s);
     tcg_temp_free_i32(r1);
     return NO_EXIT;
 }
Signature · 1 line
2.9.3
#9 lore raw

[Qemu-devel] [PULL 9/9] target/s390x: implement serialization in BRANCH CONDITION

In reply to Richard Henderson

From: Aurelien Jarno <[email protected]>

Message-Id: <[email protected]>

---
 target/s390x/translate.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
target/s390x/translate.c +15 -0
index 3a0a3ee..4c48c59 100644
@@ -1518,6 +1518,21 @@ static ExitStatus op_bc(DisasContext *s, DisasOps *o)
     int imm = is_imm ? get_field(s->fields, i2) : 0;
     DisasCompare c;
 
+    /* BCR with R2 = 0 causes no branching */
+    if (have_field(s->fields, r2) && get_field(s->fields, r2) == 0) {
+        if (m1 == 14) {
+            /* Perform serialization */
+            /* FIXME: check for fast-BCR-serialization facility */
+            tcg_gen_mb(TCG_MO_ALL | TCG_BAR_SC);
+        }
+        if (m1 == 15) {
+            /* Perform serialization */
+            /* FIXME: perform checkpoint-synchronisation */
+            tcg_gen_mb(TCG_MO_ALL | TCG_BAR_SC);
+        }
+        return NO_EXIT;
+    }
+
     disas_jcc(s, &c, m1);
     return help_branch(s, &c, is_imm, imm, o->in2);
 }
Signature · 1 line
2.9.3
#10 lore raw
In reply to Richard Henderson
Quoted 40 lines · Richard Henderson

This is a combination of my queued patches and those posted by Aurelien this week.

r~

The following changes since commit ecc1f5adeec4e3324d1b695a7c54e3967c526949:

maintainers: Add myself as linux-user reviewer (2017-05-11 13:31:11 -0400)

are available in the git repository at:

git://github.com/rth7680/qemu.git tags/pull-s390-20170512

for you to fetch changes up to 538fad597d898f677f81cb4daacd37e7cdc18e6e:

target/s390x: implement serialization in BRANCH CONDITION (2017-05-12 15:48:41 -0700)

----------------------------------------------------------------
Queued target/s390 patches

----------------------------------------------------------------
Aurelien Jarno (3):

      target/s390x: mask the SIGP order_code using SIGP_ORDER_MASK
      target/s390x: fix SIGNAL PROCESSOR return value
      target/s390x: implement serialization in BRANCH CONDITION

Eric Bischoff (1):

      target/s390x: Implement LOAD PAIR DISJOINT

Miroslav Benes (1):

      target/s390x: Implement LOAD PROGRAM PARAMETER

Richard Henderson (4):

      target/s390x: Implement STORE FACILITIES LIST EXTENDED
      target/s390x: Diagnose specification exception for atomics
      target/s390x: Use atomic operations for COMPARE SWAP
      target/s390x: Use atomic operations for LOAD AND OP
Quoted 11 lines
 target/s390x/cpu.c         |   1 +
 target/s390x/cpu.h         |   6 ++
 target/s390x/helper.c      |  16 +++
 target/s390x/helper.h      |   3 +
 target/s390x/insn-data.def |  38 ++++---
 target/s390x/kvm.c         |   2 -
 target/s390x/mem_helper.c  |  40 ++++++++
 target/s390x/misc_helper.c |  62 +++++++++++-
 target/s390x/translate.c   | 245 ++++++++++++++++++++++++++-------------------
 9 files changed, 288 insertions(+), 125 deletions(-)

Thanks, applied to my staging tree:
https://github.com/stefanha/qemu/commits/staging

Stefan