summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Hildenbrand2017-09-13 15:24:05 +0200
committerCornelia Huck2017-09-19 18:31:31 +0200
commite0b1a8a14e6bfcd66e1c20d6711f92ac86861e6b (patch)
tree1cb9060af20a6e50e9fa8129a8c1f451f3bfca31
parenttarget/s390x: use trigger_pgm_exception() in s390_cpu_handle_mmu_fault() (diff)
downloadqemu-e0b1a8a14e6bfcd66e1c20d6711f92ac86861e6b.tar.gz
qemu-e0b1a8a14e6bfcd66e1c20d6711f92ac86861e6b.tar.xz
qemu-e0b1a8a14e6bfcd66e1c20d6711f92ac86861e6b.zip
target/s390x: use program_interrupt() in per_check_exception()
Clean it up by reusing program_interrupt(). Add a concern regarding ilen. Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20170913132417.24384-11-david@redhat.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
-rw-r--r--target/s390x/misc_helper.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/target/s390x/misc_helper.c b/target/s390x/misc_helper.c
index 8b07535b02..f3624d75eb 100644
--- a/target/s390x/misc_helper.c
+++ b/target/s390x/misc_helper.c
@@ -447,14 +447,17 @@ void HELPER(chsc)(CPUS390XState *env, uint64_t inst)
#ifndef CONFIG_USER_ONLY
void HELPER(per_check_exception)(CPUS390XState *env)
{
- CPUState *cs = CPU(s390_env_get_cpu(env));
+ uint32_t ilen;
if (env->per_perc_atmid) {
- env->int_pgm_code = PGM_PER;
- env->int_pgm_ilen = get_ilen(cpu_ldub_code(env, env->per_address));
-
- cs->exception_index = EXCP_PGM;
- cpu_loop_exit(cs);
+ /*
+ * FIXME: ILEN_AUTO is most probably the right thing to use. ilen
+ * always has to match the instruction referenced in the PSW. E.g.
+ * if a PER interrupt is triggered via EXECUTE, we have to use ilen
+ * of EXECUTE, while per_address contains the target of EXECUTE.
+ */
+ ilen = get_ilen(cpu_ldub_code(env, env->per_address));
+ program_interrupt(env, PGM_PER, ilen);
}
}