From 981a8ea0c549df539962bf8c6253f73dde3cf1cc Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Fri, 19 May 2017 11:43:08 -0700 Subject: target/s390x: Use unwind data for helper_tr Reviewed-by: Aurelien Jarno Signed-off-by: Richard Henderson --- target/s390x/mem_helper.c | 25 +++++++++++++++---------- target/s390x/translate.c | 1 - 2 files changed, 15 insertions(+), 11 deletions(-) (limited to 'target/s390x') diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c index 0701e10..b37a963 100644 --- a/target/s390x/mem_helper.c +++ b/target/s390x/mem_helper.c @@ -723,19 +723,24 @@ void HELPER(unpk)(CPUS390XState *env, uint32_t len, uint64_t dest, } } -void HELPER(tr)(CPUS390XState *env, uint32_t len, uint64_t array, - uint64_t trans) +static void do_helper_tr(CPUS390XState *env, uint32_t len, uint64_t array, + uint64_t trans, uintptr_t ra) { - int i; + uint32_t i; for (i = 0; i <= len; i++) { - uint8_t byte = cpu_ldub_data(env, array + i); - uint8_t new_byte = cpu_ldub_data(env, trans + byte); - - cpu_stb_data(env, array + i, new_byte); + uint8_t byte = cpu_ldub_data_ra(env, array + i, ra); + uint8_t new_byte = cpu_ldub_data_ra(env, trans + byte, ra); + cpu_stb_data_ra(env, array + i, new_byte, ra); } } +void HELPER(tr)(CPUS390XState *env, uint32_t len, uint64_t array, + uint64_t trans) +{ + return do_helper_tr(env, len, array, trans, GETPC()); +} + uint64_t HELPER(tre)(CPUS390XState *env, uint64_t array, uint64_t len, uint64_t trans) { @@ -1265,9 +1270,9 @@ uint32_t HELPER(ex)(CPUS390XState *env, uint32_t cc, uint64_t v1, get_address(env, 0, b2, d2), 0); break; case 0xc00: - helper_tr(env, l, get_address(env, 0, b1, d1), - get_address(env, 0, b2, d2)); - break; + do_helper_tr(env, l, get_address(env, 0, b1, d1), + get_address(env, 0, b2, d2), 0); + return cc; case 0xd00: cc = helper_trt(env, l, get_address(env, 0, b1, d1), get_address(env, 0, b2, d2)); diff --git a/target/s390x/translate.c b/target/s390x/translate.c index 10262f5..e4da94d 100644 --- a/target/s390x/translate.c +++ b/target/s390x/translate.c @@ -4070,7 +4070,6 @@ static ExitStatus op_tprot(DisasContext *s, DisasOps *o) static ExitStatus op_tr(DisasContext *s, DisasOps *o) { TCGv_i32 l = tcg_const_i32(get_field(s->fields, l1)); - potential_page_fault(s); gen_helper_tr(cpu_env, l, o->addr1, o->in2); tcg_temp_free_i32(l); set_cc_static(s); -- cgit v1.1