Skip to content

Commit

Permalink
target/s390x: Fix ICM with M3=0
Browse files Browse the repository at this point in the history
When the mask is zero, access exceptions should still be recognized for
1 byte at the second-operand address. CC should be set to 0.

Cc: qemu-stable@nongnu.org
Fixes: e023e83 ("s390x: translate engine for s390x CPU")
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Message-Id: <20230724082032.66864-5-iii@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
  • Loading branch information
iii-i authored and huth committed Jul 24, 2023
1 parent 53684e3 commit a202555
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions target/s390x/tcg/translate.c
Original file line number Diff line number Diff line change
Expand Up @@ -2515,6 +2515,12 @@ static DisasJumpType op_icm(DisasContext *s, DisasOps *o)
ccm = ((1ull << len) - 1) << pos;
break;

case 0:
/* Recognize access exceptions for the first byte. */
tcg_gen_qemu_ld_i64(tmp, o->in2, get_mem_index(s), MO_UB);
gen_op_movi_cc(s, 0);
return DISAS_NEXT;

default:
/* This is going to be a sequence of loads and inserts. */
pos = base + 32 - 8;
Expand Down

0 comments on commit a202555

Please sign in to comment.