From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50190) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHZRL-0007Yk-Ck for qemu-devel@nongnu.org; Sun, 04 Jun 2017 13:35:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dHZRJ-00039w-Dx for qemu-devel@nongnu.org; Sun, 04 Jun 2017 13:35:47 -0400 Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]:35775) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dHZRJ-00039V-7L for qemu-devel@nongnu.org; Sun, 04 Jun 2017 13:35:45 -0400 Received: by mail-pg0-x241.google.com with SMTP id f127so7255455pgc.2 for ; Sun, 04 Jun 2017 10:35:45 -0700 (PDT) Sender: Richard Henderson From: Richard Henderson Date: Sun, 4 Jun 2017 10:34:23 -0700 Message-Id: <20170604173509.29684-24-rth@twiddle.net> In-Reply-To: <20170604173509.29684-1-rth@twiddle.net> References: <20170604173509.29684-1-rth@twiddle.net> Subject: [Qemu-devel] [PULL 23/69] target/s390x: Use unwind data for helper_trt List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, aurelien@aurel32.net Reviewed-by: Thomas Huth Reviewed-by: Aurelien Jarno Signed-off-by: Richard Henderson --- target/s390x/mem_helper.c | 28 ++++++++++++++++------------ target/s390x/translate.c | 1 - 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c index fd6dbf7..ff12777 100644 --- a/target/s390x/mem_helper.c +++ b/target/s390x/mem_helper.c @@ -781,25 +781,29 @@ uint64_t HELPER(tre)(CPUS390XState *env, uint64_t array, return array + i; } -uint32_t HELPER(trt)(CPUS390XState *env, uint32_t len, uint64_t array, - uint64_t trans) +static uint32_t do_helper_trt(CPUS390XState *env, uint32_t len, uint64_t array, + uint64_t trans, uintptr_t ra) { - uint32_t cc = 0; - int i; + uint32_t i; for (i = 0; i <= len; i++) { - uint8_t byte = cpu_ldub_data(env, array + i); - uint8_t sbyte = cpu_ldub_data(env, trans + byte); + uint8_t byte = cpu_ldub_data_ra(env, array + i, ra); + uint8_t sbyte = cpu_ldub_data_ra(env, trans + byte, ra); if (sbyte != 0) { env->regs[1] = array + i; - env->regs[2] = (env->regs[2] & ~0xff) | sbyte; - cc = (i == len) ? 2 : 1; - break; + env->regs[2] = deposit64(env->regs[2], 0, 8, sbyte); + return (i == len) ? 2 : 1; } } - return cc; + return 0; +} + +uint32_t HELPER(trt)(CPUS390XState *env, uint32_t len, uint64_t array, + uint64_t trans) +{ + return do_helper_trt(env, len, array, trans, GETPC()); } void HELPER(cdsg)(CPUS390XState *env, uint64_t addr, @@ -1275,8 +1279,8 @@ uint32_t HELPER(ex)(CPUS390XState *env, uint32_t cc, uint64_t v1, 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)); + cc = do_helper_trt(env, l, get_address(env, 0, b1, d1), + get_address(env, 0, b2, d2), 0); break; default: goto abort; diff --git a/target/s390x/translate.c b/target/s390x/translate.c index 447ba07..fed9f17 100644 --- a/target/s390x/translate.c +++ b/target/s390x/translate.c @@ -4082,7 +4082,6 @@ static ExitStatus op_tre(DisasContext *s, DisasOps *o) static ExitStatus op_trt(DisasContext *s, DisasOps *o) { TCGv_i32 l = tcg_const_i32(get_field(s->fields, l1)); - potential_page_fault(s); gen_helper_trt(cc_op, cpu_env, l, o->addr1, o->in2); tcg_temp_free_i32(l); set_cc_static(s); -- 2.9.4