Generate a specification exception in the helper before trying to fetch
the instruction.
Reported-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com>
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20230316164428.275147-3-iii@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
*/
void HELPER(ex)(CPUS390XState *env, uint32_t ilen, uint64_t r1, uint64_t addr)
{
- uint64_t insn = cpu_lduw_code(env, addr);
- uint8_t opc = insn >> 8;
+ uint64_t insn;
+ uint8_t opc;
+
+ /* EXECUTE targets must be at even addresses. */
+ if (addr & 1) {
+ tcg_s390_program_interrupt(env, PGM_SPECIFICATION, GETPC());
+ }
+
+ insn = cpu_lduw_code(env, addr);
+ opc = insn >> 8;
/* Or in the contents of R1[56:63]. */
insn |= r1 & 0xff;