From: "Andreas Färber" <afaerber@suse.de>
To: Meador Inge <meadori@codesourcery.com>
Cc: Khansa Butt <khansa@kics.edu.pk>,
"Maciej W. Rozycki" <macro@codesourcery.com>,
qemu-devel@nongnu.org, aurelien@aurel32.net
Subject: Re: [Qemu-devel] [PATCH v1 1/1] mips: properly compute hflags and fcr0 on cpu reset
Date: Sat, 03 Mar 2012 17:45:10 +0100 [thread overview]
Message-ID: <4F524A96.3030206@suse.de> (raw)
In-Reply-To: <1330722210-13488-1-git-send-email-meadori@codesourcery.com>
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:
>
> qemu: uncaught target signal 4 (Illegal instruction) - core dumped
> Illegal instruction (core dumped)
>
> because fcr0 is bogus and MIPS_HFLAG_COP1X is not correcly set in hflags.
>
> 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 <khansa@kics.edu.pk>
e.g., http://patchwork.ozlabs.org/patch/133974/
Your use of compute_hflags() looks more future-proof.
>
> Signed-off-by: Maciej W. Rozycki <macro@codesourcery.com>
> Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
> Signed-off-by: Meador Inge <meadori@codesourcery.com>
> ---
> target-mips/cpu.h | 49 +++++++++++++++++++++++++++++++++++++++++++++++
> target-mips/op_helper.c | 49 -----------------------------------------------
> target-mips/translate.c | 17 +++------------
> 3 files changed, 53 insertions(+), 62 deletions(-)
>
> 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, TranslationBlock *tb)
> env->hflags |= tb->flags & MIPS_HFLAG_BMASK;
> }
>
> +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ärber <afaerber@suse.de>
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
next prev parent reply other threads:[~2012-03-03 16:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-02 21:03 [Qemu-devel] [PATCH v1 1/1] mips: properly compute hflags and fcr0 on cpu reset Meador Inge
2012-03-03 16:45 ` Andreas Färber [this message]
2012-03-03 17:26 ` Meador Inge
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F524A96.3030206@suse.de \
--to=afaerber@suse.de \
--cc=aurelien@aurel32.net \
--cc=khansa@kics.edu.pk \
--cc=macro@codesourcery.com \
--cc=meadori@codesourcery.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).