diff options
author | David Hildenbrand <david@redhat.com> | 2018-09-27 15:02:56 +0200 |
---|---|---|
committer | Cornelia Huck <cohuck@redhat.com> | 2018-10-04 10:32:39 +0200 |
commit | bbf6ea3bd961970785a583117ac1c0b84a8ee736 (patch) | |
tree | 8c00137c06cfbdbec9a51a6b0fe09e2d7d147052 /target/s390x/translate.c | |
parent | 52341ed61d3a7b84602f6ee6b4234027ed5e6172 (diff) |
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 <richard.henderson@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20180927130303.12236-3-david@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Diffstat (limited to 'target/s390x/translate.c')
-rw-r--r-- | target/s390x/translate.c | 19 |
1 files changed, 9 insertions, 10 deletions
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 |