]> git.proxmox.com Git - mirror_qemu.git/commitdiff
target/s390x: Fix EPSW CC reporting
authorIlya Leoshkevich <iii@linux.ibm.com>
Tue, 4 Jul 2023 08:12:26 +0000 (10:12 +0200)
committerThomas Huth <thuth@redhat.com>
Mon, 10 Jul 2023 13:34:23 +0000 (15:34 +0200)
EPSW should explicitly calculate and insert CC, like IPM does.

Fixes: e30a9d3fea58 ("target-s390: Implement EPSW")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Cc: qemu-stable@nongnu.org
Message-Id: <20230704081506.276055-3-iii@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
target/s390x/tcg/translate.c

index a6ee2d442349cc35e5ea3fcbda45aa2e4ddf03ba..0cef6efbef4e73a1e751a7884489c995179a6e30 100644 (file)
@@ -2383,10 +2383,14 @@ static DisasJumpType op_epsw(DisasContext *s, DisasOps *o)
     int r1 = get_field(s, r1);
     int r2 = get_field(s, r2);
     TCGv_i64 t = tcg_temp_new_i64();
+    TCGv_i64 t_cc = tcg_temp_new_i64();
 
     /* Note the "subsequently" in the PoO, which implies a defined result
        if r1 == r2.  Thus we cannot defer these writes to an output hook.  */
+    gen_op_calc_cc(s);
+    tcg_gen_extu_i32_i64(t_cc, cc_op);
     tcg_gen_shri_i64(t, psw_mask, 32);
+    tcg_gen_deposit_i64(t, t, t_cc, 12, 2);
     store_reg32_i64(r1, t);
     if (r2 != 0) {
         store_reg32_i64(r2, psw_mask);