From nobody Sat Feb 7 08:27:56 2026 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1511901372712892.0047968836365; Tue, 28 Nov 2017 12:36:12 -0800 (PST) Received: from localhost ([::1]:39980 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eJmbe-000293-S9 for importer@patchew.org; Tue, 28 Nov 2017 15:35:50 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46310) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eJmZZ-0000pg-8M for qemu-devel@nongnu.org; Tue, 28 Nov 2017 15:33:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eJmZX-0003b1-VD for qemu-devel@nongnu.org; Tue, 28 Nov 2017 15:33:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60304) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eJmZX-0003aF-NT; Tue, 28 Nov 2017 15:33:39 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C1E3F5F73A; Tue, 28 Nov 2017 20:33:38 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-100.ams2.redhat.com [10.36.116.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 29DE460600; Tue, 28 Nov 2017 20:33:36 +0000 (UTC) From: David Hildenbrand To: qemu-s390x@nongnu.org, qemu-devel@nongnu.org Date: Tue, 28 Nov 2017 21:33:12 +0100 Message-Id: <20171128203326.6062-3-david@redhat.com> In-Reply-To: <20171128203326.6062-1-david@redhat.com> References: <20171128203326.6062-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 28 Nov 2017 20:33:38 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v1 for-2.12 02/15] s390x/tcg: get rid of runtime_exception() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Borntraeger , Cornelia Huck , David Hildenbrand , Alexander Graf , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Let's use program_interrupt_ra() instead. Signed-off-by: David Hildenbrand Reviewed-by: Richard Henderson --- target/s390x/fpu_helper.c | 2 +- target/s390x/int_helper.c | 14 +++++++------- target/s390x/internal.h | 2 -- target/s390x/misc_helper.c | 16 ---------------- 4 files changed, 8 insertions(+), 26 deletions(-) diff --git a/target/s390x/fpu_helper.c b/target/s390x/fpu_helper.c index ffbeb3b2df..0ba347668c 100644 --- a/target/s390x/fpu_helper.c +++ b/target/s390x/fpu_helper.c @@ -44,7 +44,7 @@ static void ieee_exception(CPUS390XState *env, uint32_t d= xc, uintptr_t retaddr) /* Install the DXC code. */ env->fpc =3D (env->fpc & ~0xff00) | (dxc << 8); /* Trap. */ - runtime_exception(env, PGM_DATA, retaddr); + program_interrupt_ra(env, PGM_DATA, ILEN_AUTO, retaddr); } =20 /* Should be called after any operation that may raise IEEE exceptions. */ diff --git a/target/s390x/int_helper.c b/target/s390x/int_helper.c index 0076bea047..f384b14eab 100644 --- a/target/s390x/int_helper.c +++ b/target/s390x/int_helper.c @@ -39,7 +39,7 @@ int64_t HELPER(divs32)(CPUS390XState *env, int64_t a, int= 64_t b64) int64_t q; =20 if (b =3D=3D 0) { - runtime_exception(env, PGM_FIXPT_DIVIDE, GETPC()); + program_interrupt_ra(env, PGM_FIXPT_DIVIDE, ILEN_AUTO, GETPC()); } =20 ret =3D q =3D a / b; @@ -47,7 +47,7 @@ int64_t HELPER(divs32)(CPUS390XState *env, int64_t a, int= 64_t b64) =20 /* Catch non-representable quotient. */ if (ret !=3D q) { - runtime_exception(env, PGM_FIXPT_DIVIDE, GETPC()); + program_interrupt_ra(env, PGM_FIXPT_DIVIDE, ILEN_AUTO, GETPC()); } =20 return ret; @@ -60,7 +60,7 @@ uint64_t HELPER(divu32)(CPUS390XState *env, uint64_t a, u= int64_t b64) uint64_t q; =20 if (b =3D=3D 0) { - runtime_exception(env, PGM_FIXPT_DIVIDE, GETPC()); + program_interrupt_ra(env, PGM_FIXPT_DIVIDE, ILEN_AUTO, GETPC()); } =20 ret =3D q =3D a / b; @@ -68,7 +68,7 @@ uint64_t HELPER(divu32)(CPUS390XState *env, uint64_t a, u= int64_t b64) =20 /* Catch non-representable quotient. */ if (ret !=3D q) { - runtime_exception(env, PGM_FIXPT_DIVIDE, GETPC()); + program_interrupt_ra(env, PGM_FIXPT_DIVIDE, ILEN_AUTO, GETPC()); } =20 return ret; @@ -79,7 +79,7 @@ int64_t HELPER(divs64)(CPUS390XState *env, int64_t a, int= 64_t b) { /* Catch divide by zero, and non-representable quotient (MIN / -1). */ if (b =3D=3D 0 || (b =3D=3D -1 && a =3D=3D (1ll << 63))) { - runtime_exception(env, PGM_FIXPT_DIVIDE, GETPC()); + program_interrupt_ra(env, PGM_FIXPT_DIVIDE, ILEN_AUTO, GETPC()); } env->retxl =3D a % b; return a / b; @@ -92,7 +92,7 @@ uint64_t HELPER(divu64)(CPUS390XState *env, uint64_t ah, = uint64_t al, uint64_t ret; /* Signal divide by zero. */ if (b =3D=3D 0) { - runtime_exception(env, PGM_FIXPT_DIVIDE, GETPC()); + program_interrupt_ra(env, PGM_FIXPT_DIVIDE, ILEN_AUTO, GETPC()); } if (ah =3D=3D 0) { /* 64 -> 64/64 case */ @@ -106,7 +106,7 @@ uint64_t HELPER(divu64)(CPUS390XState *env, uint64_t ah= , uint64_t al, env->retxl =3D a % b; ret =3D q; if (ret !=3D q) { - runtime_exception(env, PGM_FIXPT_DIVIDE, GETPC()); + program_interrupt_ra(env, PGM_FIXPT_DIVIDE, ILEN_AUTO, GETPC()= ); } #else S390CPU *cpu =3D s390_env_get_cpu(env); diff --git a/target/s390x/internal.h b/target/s390x/internal.h index 3aff54ada4..db39d5bfac 100644 --- a/target/s390x/internal.h +++ b/target/s390x/internal.h @@ -408,8 +408,6 @@ int mmu_translate_real(CPUS390XState *env, target_ulong= raddr, int rw, =20 =20 /* misc_helper.c */ -void QEMU_NORETURN runtime_exception(CPUS390XState *env, int excp, - uintptr_t retaddr); int handle_diag_288(CPUS390XState *env, uint64_t r1, uint64_t r3); void handle_diag_308(CPUS390XState *env, uint64_t r1, uint64_t r3); =20 diff --git a/target/s390x/misc_helper.c b/target/s390x/misc_helper.c index fbb446db70..6f29f92b94 100644 --- a/target/s390x/misc_helper.c +++ b/target/s390x/misc_helper.c @@ -45,22 +45,6 @@ #define HELPER_LOG(x...) #endif =20 -/* Raise an exception dynamically from a helper function. */ -void QEMU_NORETURN runtime_exception(CPUS390XState *env, int excp, - uintptr_t retaddr) -{ - CPUState *cs =3D CPU(s390_env_get_cpu(env)); - - cs->exception_index =3D EXCP_PGM; - env->int_pgm_code =3D excp; - env->int_pgm_ilen =3D ILEN_AUTO; - - /* Use the (ultimate) callers address to find the insn that trapped. = */ - cpu_restore_state(cs, retaddr); - - cpu_loop_exit(cs); -} - /* Raise an exception statically from a TB. */ void HELPER(exception)(CPUS390XState *env, uint32_t excp) { --=20 2.14.3