|
From: | Richard Henderson |
Subject: | Re: [PATCH 01/12] target/s390x: Handle branching to odd addresses |
Date: | Fri, 10 Mar 2023 11:24:17 -0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 |
On 3/10/23 09:42, Ilya Leoshkevich wrote:
@@ -381,6 +382,14 @@ static inline int cpu_mmu_index(CPUS390XState *env, bool ifetch) static inline void cpu_get_tb_cpu_state(CPUS390XState* env, target_ulong *pc, target_ulong *cs_base, uint32_t *flags) { + if (env->psw.addr & 1) { + /* + * Instructions must be at even addresses. + * This needs to be checked before address translation. + */ + env->int_pgm_ilen = 2; /* see s390_cpu_tlb_fill() */ + tcg_s390_program_interrupt(env, PGM_SPECIFICATION, 0); + }
This is incorrect placement. You can't raise an exception from all of the places from which this is called.
You need to do this at the start of s390x_tr_translate_insn. Compare aarch64_tr_translate_insn and the test for (pc & 3). r~
[Prev in Thread] | Current Thread | [Next in Thread] |