aboutsummaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorIlya Leoshkevich <iii@linux.ibm.com>2023-07-24 10:15:54 +0200
committerMichael Tokarev <mjt@tls.msk.ru>2023-07-31 09:10:51 +0300
commitbdbf5e10166ea9f9955d5118a44a8498ebc603bb (patch)
treee62166f448677348c10a41087544b40123cfb131 /target
parent6f7c39a912a601f40681426b16f772db3697e2d1 (diff)
target/s390x: Make CKSM raise an exception if R2 is odd
R2 designates an even-odd register pair; the instruction should raise a specification exception when R2 is not even. Cc: qemu-stable@nongnu.org Fixes: e023e832d0ac ("s390x: translate engine for s390x CPU") Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Message-Id: <20230724082032.66864-2-iii@linux.ibm.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: David Hildenbrand <david@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com> (cherry picked from commit 761b0aa9381e2f755b9b594f7f3033d564561751) Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'target')
-rw-r--r--target/s390x/tcg/insn-data.h.inc2
-rw-r--r--target/s390x/tcg/translate.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/target/s390x/tcg/insn-data.h.inc b/target/s390x/tcg/insn-data.h.inc
index 295eb07173..4f795c07f7 100644
--- a/target/s390x/tcg/insn-data.h.inc
+++ b/target/s390x/tcg/insn-data.h.inc
@@ -157,7 +157,7 @@
C(0xb2fa, NIAI, E, EH, 0, 0, 0, 0, 0, 0)
/* CHECKSUM */
- C(0xb241, CKSM, RRE, Z, r1_o, ra2, new, r1_32, cksm, 0)
+ C(0xb241, CKSM, RRE, Z, r1_o, ra2_E, new, r1_32, cksm, 0)
/* COPY SIGN */
F(0xb372, CPSDR, RRF_b, FPSSH, f3, f2, new, f1, cps, 0, IF_AFP1 | IF_AFP2 | IF_AFP3)
diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c
index c7498ff3f2..f005539861 100644
--- a/target/s390x/tcg/translate.c
+++ b/target/s390x/tcg/translate.c
@@ -5800,6 +5800,12 @@ static void in2_ra2(DisasContext *s, DisasOps *o)
}
#define SPEC_in2_ra2 0
+static void in2_ra2_E(DisasContext *s, DisasOps *o)
+{
+ return in2_ra2(s, o);
+}
+#define SPEC_in2_ra2_E SPEC_r2_even
+
static void in2_a2(DisasContext *s, DisasOps *o)
{
int x2 = have_field(s, x2) ? get_field(s, x2) : 0;