From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41643) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVmSn-0003ho-G5 for qemu-devel@nongnu.org; Mon, 14 Oct 2013 14:01:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VVmSi-0007SW-5t for qemu-devel@nongnu.org; Mon, 14 Oct 2013 14:01:53 -0400 Received: from cantor2.suse.de ([195.135.220.15]:38942 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVmSh-0007SR-SU for qemu-devel@nongnu.org; Mon, 14 Oct 2013 14:01:48 -0400 Message-ID: <525C3187.5070705@suse.de> Date: Mon, 14 Oct 2013 20:01:43 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1381768175-13520-1-git-send-email-michael@walle.cc> <1381768175-13520-7-git-send-email-michael@walle.cc> In-Reply-To: <1381768175-13520-7-git-send-email-michael@walle.cc> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PULL v2 06/11] target-lm32: kill cpu_abort() calls List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Walle Cc: qemu-devel@nongnu.org Am 14.10.2013 18:29, schrieb Michael Walle: > Instead of killing QEMU, translate instructions which are not available= on > the CPU model as a noop and issue a log message at translation time. >=20 > On the real hardware CPU unknown opcodes results in undefined behaviour= . >=20 > These changes prepare the removal of CPULM32State from DisasContext. >=20 > Cc: Andreas F=C3=A4rber > Signed-off-by: Michael Walle > --- > target-lm32/translate.c | 72 ++++++++++++++++++++++++++-------------= -------- > 1 file changed, 40 insertions(+), 32 deletions(-) >=20 > diff --git a/target-lm32/translate.c b/target-lm32/translate.c > index 6ea0ecd..eda8caa 100644 > --- a/target-lm32/translate.c > +++ b/target-lm32/translate.c > @@ -80,7 +80,6 @@ typedef struct DisasContext { > unsigned int tb_flags, synced_flags; /* tb dependent flags. */ > int is_jmp; > =20 > - int nr_nops; > struct TranslationBlock *tb; > int singlestep_enabled; > } DisasContext; > @@ -422,7 +421,8 @@ static void dec_divu(DisasContext *dc) > LOG_DIS("divu r%d, r%d, r%d\n", dc->r2, dc->r0, dc->r1); > =20 > if (!(dc->env->features & LM32_FEATURE_DIVIDE)) { > - cpu_abort(dc->env, "hardware divider is not available\n"); > + qemu_log_mask(LOG_GUEST_ERROR, "hardware divider is not availa= ble\n"); > + return; > } > =20 > l1 =3D gen_new_label(); > @@ -500,7 +500,8 @@ static void dec_modu(DisasContext *dc) > LOG_DIS("modu r%d, r%d, %d\n", dc->r2, dc->r0, dc->r1); > =20 > if (!(dc->env->features & LM32_FEATURE_DIVIDE)) { > - cpu_abort(dc->env, "hardware divider is not available\n"); > + qemu_log_mask(LOG_GUEST_ERROR, "hardware divider is not availa= ble\n"); > + return; > } > =20 > l1 =3D gen_new_label(); > @@ -521,7 +522,9 @@ static void dec_mul(DisasContext *dc) > } > =20 > if (!(dc->env->features & LM32_FEATURE_MULTIPLY)) { > - cpu_abort(dc->env, "hardware multiplier is not available\n"); > + qemu_log_mask(LOG_GUEST_ERROR, > + "hardware multiplier is not available\n"); [snip] If you do respin, could you align with opening parenthesis here and below, please? Otherwise looks good and you can add my Reviewed-by then. Thanks! Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg