From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54247) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3s58-0005ZG-LI for qemu-devel@nongnu.org; Sat, 03 Mar 2012 11:45:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S3s56-00074x-Bz for qemu-devel@nongnu.org; Sat, 03 Mar 2012 11:45:18 -0500 Received: from cantor2.suse.de ([195.135.220.15]:41000 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3s56-00074p-2e for qemu-devel@nongnu.org; Sat, 03 Mar 2012 11:45:16 -0500 Message-ID: <4F524A96.3030206@suse.de> Date: Sat, 03 Mar 2012 17:45:10 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1330722210-13488-1-git-send-email-meadori@codesourcery.com> In-Reply-To: <1330722210-13488-1-git-send-email-meadori@codesourcery.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v1 1/1] mips: properly compute hflags and fcr0 on cpu reset List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Meador Inge Cc: Khansa Butt , "Maciej W. Rozycki" , qemu-devel@nongnu.org, aurelien@aurel32.net Am 02.03.2012 22:03, schrieb Meador Inge: > Currently 'cpu_reset' doesn't fully compute all of the needed > HFLAGs and fails to setup fcr0 after clearing the CPU state. > This can cause instruction exceptions. For example, using > 'madd.d' on machines that should support it is kindly greeted > with: >=20 > qemu: uncaught target signal 4 (Illegal instruction) - core dumped > Illegal instruction (core dumped) >=20 > because fcr0 is bogus and MIPS_HFLAG_COP1X is not correcly set in hflag= s. >=20 > This is fixed by modifying 'cpu_reset' to use 'compute_hflags' and > initializing 'fcr0' from the current CPU model. fcr0 issue has also been Reported-by: Khansa Butt e.g., http://patchwork.ozlabs.org/patch/133974/ Your use of compute_hflags() looks more future-proof. >=20 > Signed-off-by: Maciej W. Rozycki > Signed-off-by: Nathan Froyd > Signed-off-by: Meador Inge > --- > target-mips/cpu.h | 49 +++++++++++++++++++++++++++++++++++++++= ++++++++ > target-mips/op_helper.c | 49 ---------------------------------------= -------- > target-mips/translate.c | 17 +++------------ > 3 files changed, 53 insertions(+), 62 deletions(-) >=20 > diff --git a/target-mips/cpu.h b/target-mips/cpu.h > index 71cb4e8..fc65348 100644 > --- a/target-mips/cpu.h > +++ b/target-mips/cpu.h > @@ -737,4 +737,53 @@ static inline void cpu_pc_from_tb(CPUState *env, T= ranslationBlock *tb) > env->hflags |=3D tb->flags & MIPS_HFLAG_BMASK; > } > =20 > +static inline void compute_hflags(CPUState *env) > +{ Moving helper functions like these to cpu.h has proven troublesome for QOM'ification (when they need access to MIPSCPU[Class] in addition to CPUMIPSState) but it'll do for now. Reviewed-by: Andreas F=E4rber Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg