[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 10/22] target/s390x: Raise exception from per_store_real
From: |
Thomas Huth |
Subject: |
[PULL 10/22] target/s390x: Raise exception from per_store_real |
Date: |
Wed, 29 May 2024 12:54:42 +0200 |
From: Richard Henderson <richard.henderson@linaro.org>
At this point the instruction is complete and there's nothing
left to do but raise the exception. With this change we need
not make two helper calls for this event.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20240502054417.234340-11-richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
target/s390x/helper.h | 2 +-
target/s390x/tcg/misc_helper.c | 4 +++-
target/s390x/tcg/translate.c | 7 ++++---
3 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/target/s390x/helper.h b/target/s390x/helper.h
index 061b379065..5611155ba1 100644
--- a/target/s390x/helper.h
+++ b/target/s390x/helper.h
@@ -362,7 +362,7 @@ DEF_HELPER_3(lra, i64, env, i64, i64)
DEF_HELPER_FLAGS_3(per_check_exception, TCG_CALL_NO_WG, void, env, i64, i32)
DEF_HELPER_FLAGS_3(per_branch, TCG_CALL_NO_WG, void, env, i64, i32)
DEF_HELPER_FLAGS_2(per_ifetch, TCG_CALL_NO_RWG, void, env, i64)
-DEF_HELPER_FLAGS_1(per_store_real, TCG_CALL_NO_RWG, void, env)
+DEF_HELPER_FLAGS_2(per_store_real, TCG_CALL_NO_WG, noreturn, env, i32)
DEF_HELPER_FLAGS_1(stfl, TCG_CALL_NO_RWG, void, env)
DEF_HELPER_2(xsch, void, env, i64)
diff --git a/target/s390x/tcg/misc_helper.c b/target/s390x/tcg/misc_helper.c
index 974d14703c..43cacc448f 100644
--- a/target/s390x/tcg/misc_helper.c
+++ b/target/s390x/tcg/misc_helper.c
@@ -660,11 +660,13 @@ void HELPER(per_ifetch)(CPUS390XState *env, uint64_t addr)
}
}
-void HELPER(per_store_real)(CPUS390XState *env)
+void HELPER(per_store_real)(CPUS390XState *env, uint32_t ilen)
{
/* PSW is saved just before calling the helper. */
env->per_address = env->psw.addr;
+ env->int_pgm_ilen = ilen;
env->per_perc_atmid = PER_CODE_EVENT_STORE_REAL | get_per_atmid(env);
+ per_raise_exception_log(env);
}
#endif
diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c
index de029185e0..5bb15a46e0 100644
--- a/target/s390x/tcg/translate.c
+++ b/target/s390x/tcg/translate.c
@@ -4342,8 +4342,10 @@ static DisasJumpType op_stura(DisasContext *s, DisasOps
*o)
tcg_gen_qemu_st_tl(o->in1, o->in2, MMU_REAL_IDX, s->insn->data);
if (s->base.tb->flags & FLAG_MASK_PER_STORE_REAL) {
+ update_cc_op(s);
update_psw_addr(s);
- gen_helper_per_store_real(tcg_env);
+ gen_helper_per_store_real(tcg_env, tcg_constant_i32(s->ilen));
+ return DISAS_NORETURN;
}
return DISAS_NEXT;
}
@@ -6355,8 +6357,7 @@ static DisasJumpType translate_one(CPUS390XState *env,
DisasContext *s)
}
#ifndef CONFIG_USER_ONLY
- if (s->base.tb->flags & (FLAG_MASK_PER_STORE_REAL |
- FLAG_MASK_PER_IFETCH)) {
+ if (s->base.tb->flags & FLAG_MASK_PER_IFETCH) {
TCGv_i64 next_pc = psw_addr;
if (ret == DISAS_NEXT || ret == DISAS_TOO_MANY) {
--
2.45.1
- [PULL 00/22] s390x, build-oss-fuzz and Clang -fsanitize=undefined fixes, Thomas Huth, 2024/05/29
- [PULL 01/22] target/s390x: Do not use unwind for per_check_exception, Thomas Huth, 2024/05/29
- [PULL 02/22] target/s390x: Move cpu_get_tb_cpu_state out of line, Thomas Huth, 2024/05/29
- [PULL 04/22] target/s390x: Record separate PER bits in TB flags, Thomas Huth, 2024/05/29
- [PULL 05/22] target/s390x: Disable conditional branch-to-next for PER, Thomas Huth, 2024/05/29
- [PULL 03/22] target/s390x: Update CR9 bits, Thomas Huth, 2024/05/29
- [PULL 06/22] target/s390x: Introduce help_goto_indirect, Thomas Huth, 2024/05/29
- [PULL 07/22] target/s390x: Simplify help_branch, Thomas Huth, 2024/05/29
- [PULL 08/22] target/s390x: Split per_breaking_event from per_branch_*, Thomas Huth, 2024/05/29
- [PULL 10/22] target/s390x: Raise exception from per_store_real,
Thomas Huth <=
- [PULL 09/22] target/s390x: Raise exception from helper_per_branch, Thomas Huth, 2024/05/29
- [PULL 11/22] target/s390x: Fix helper_per_ifetch flags, Thomas Huth, 2024/05/29
- [PULL 12/22] target/s390x: Simplify per_ifetch, per_check_exception, Thomas Huth, 2024/05/29
- [PULL 13/22] target/s390x: Adjust check of noreturn in translate_one, Thomas Huth, 2024/05/29
- [PULL 14/22] tests/tcg/s390x: Add per.S, Thomas Huth, 2024/05/29
- [PULL 15/22] fuzz: specify audiodev for usb-audio, Thomas Huth, 2024/05/29
- [PULL 16/22] fuzz: disable leak-detection for oss-fuzz builds, Thomas Huth, 2024/05/29
- [PULL 18/22] scripts/update-linux-headers.sh: Remove temporary directory inbetween, Thomas Huth, 2024/05/29
- [PULL 17/22] hw/s390x: Remove unused macro VMSTATE_ADAPTER_ROUTES, Thomas Huth, 2024/05/29
- [PULL 19/22] scripts/update-linux-headers.sh: Fix the path of setup_data.h, Thomas Huth, 2024/05/29