qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] target-ppc: initialize MSR appropriately in user-mode
Date: Wed, 10 Dec 2008 16:06:06 +0100	[thread overview]
Message-ID: <20081210150606.GD19379@volta.aurel32.net> (raw)
In-Reply-To: <20081208191351.GF26277@codesourcery.com>

On Mon, Dec 08, 2008 at 11:13:51AM -0800, Nathan Froyd wrote:
> We shouldn't blindly initialize the floating-point bit in MSR; we should
> only do so if the processor we're targetting supports floating-point.
> We should also do the same thing with the Altivec and e500 bits.
> 
> Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>

I have fixed the problem by applying two different patches, one to mask
the computed MSR with the MSR mask, and one to active Altivec and SPE.

Thanks for you work.

> diff --git a/target-ppc/helper.c b/target-ppc/helper.c
> index 6bffa06..1a4d69e 100644
> --- a/target-ppc/helper.c
> +++ b/target-ppc/helper.c
> @@ -2905,7 +2905,13 @@ void cpu_ppc_reset (void *opaque)
>      msr |= (target_ulong)1 << MSR_BE;
>  #endif
>  #if defined(CONFIG_USER_ONLY)
> -    msr |= (target_ulong)1 << MSR_FP; /* Allow floating point usage */
> +    /* Initialize MSR with appropriate instruction capabilities.  */
> +    if (env->msr_mask & ((target_ulong)1 << MSR_FP))
> +      msr |= (target_ulong)1 << MSR_FP;
> +    if (env->msr_mask & ((target_ulong)1 << MSR_VR))
> +      msr |= (target_ulong)1 << MSR_VR;
> +    if (env->msr_mask & ((target_ulong)1 << MSR_SPE))
> +      msr |= (target_ulong)1 << MSR_SPE;
>      msr |= (target_ulong)1 << MSR_PR;
>  #else
>      env->nip = env->hreset_vector | env->excp_prefix;
> 
> 
> 
> 

-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net

      reply	other threads:[~2008-12-10 15:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-08 19:13 [Qemu-devel] [PATCH] target-ppc: initialize MSR appropriately in user-mode Nathan Froyd
2008-12-10 15:06 ` Aurelien Jarno [this message]

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=20081210150606.GD19379@volta.aurel32.net \
    --to=aurelien@aurel32.net \
    --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).