From bbf6ea3bd961970785a583117ac1c0b84a8ee736 Mon Sep 17 00:00:00 2001 From: David Hildenbrand Date: Thu, 27 Sep 2018 15:02:56 +0200 Subject: s390x/tcg: factor out and fix DATA exception injection The DXC is to be stored in the low core, and only in the FPC in case AFP is enabled in CR0. Stub is not required in current code, but this way we never run into problems. Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Signed-off-by: David Hildenbrand Message-Id: <20180927130303.12236-3-david@redhat.com> Signed-off-by: Cornelia Huck --- target/s390x/translate.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'target/s390x/translate.c') diff --git a/target/s390x/translate.c b/target/s390x/translate.c index 59b1e5893c..43b736335f 100644 --- a/target/s390x/translate.c +++ b/target/s390x/translate.c @@ -314,18 +314,17 @@ static inline void gen_illegal_opcode(DisasContext *s) gen_program_exception(s, PGM_OPERATION); } -static inline void gen_trap(DisasContext *s) +static inline void gen_data_exception(uint8_t dxc) { - TCGv_i32 t; - - /* Set DXC to 0xff. */ - t = tcg_temp_new_i32(); - tcg_gen_ld_i32(t, cpu_env, offsetof(CPUS390XState, fpc)); - tcg_gen_ori_i32(t, t, 0xff00); - tcg_gen_st_i32(t, cpu_env, offsetof(CPUS390XState, fpc)); - tcg_temp_free_i32(t); + TCGv_i32 tmp = tcg_const_i32(dxc); + gen_helper_data_exception(cpu_env, tmp); + tcg_temp_free_i32(tmp); +} - gen_program_exception(s, PGM_DATA); +static inline void gen_trap(DisasContext *s) +{ + /* Set DXC to 0xff */ + gen_data_exception(0xff); } #ifndef CONFIG_USER_ONLY -- cgit v1.2.3