qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: Doug Kwan <dougkwan@google.com>,
	qemu-devel@nongnu.org, qemu-ppc@nongnu.org
Cc: riku.voipio@iki.fi
Subject: Re: [Qemu-devel] [PATCH v2 2/3] PPC: Allow little-endian user mode.
Date: Tue, 13 May 2014 09:05:50 +0200	[thread overview]
Message-ID: <5371C44E.8010901@suse.de> (raw)
In-Reply-To: <1399713400-8619-3-git-send-email-dougkwan@google.com>


On 10.05.14 11:16, Doug Kwan wrote:
> This allow running PPC64 little-endian in user mode if target is configured
> that way.  In PPC64 LE user mode we set MSR.LE during initialization.
> Overhaul handling of byteswapping in code generation and mem helpers.
>
> Signed-off-by: Doug Kwan <dougkwan@google.com>
> ---
>   target-ppc/mem_helper.c     |  25 ++++++--
>   target-ppc/translate.c      | 150 +++++++++++++++++---------------------------
>   target-ppc/translate_init.c |   9 +++
>   3 files changed, 89 insertions(+), 95 deletions(-)
>

[...]

> diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
> index 4d94015..84381ae 100644
> --- a/target-ppc/translate_init.c
> +++ b/target-ppc/translate_init.c
> @@ -8418,6 +8418,9 @@ static void ppc_cpu_reset(CPUState *s)
>       msr |= (target_ulong)1 << MSR_VR; /* Allow altivec usage */
>       msr |= (target_ulong)1 << MSR_SPE; /* Allow SPE usage */
>       msr |= (target_ulong)1 << MSR_PR;
> +#if !defined(TARGET_WORDS_BIGENDIAN)
> +    msr |= (target_ulong)1 << MSR_LE; /* Little-endian user mode */
> +#endif
>   #endif
>   
>   #if defined(TARGET_PPC64)
> @@ -8461,6 +8464,12 @@ static void ppc_cpu_reset(CPUState *s)
>   
>       /* Flush all TLBs */
>       tlb_flush(s, 1);
> +
> +#if defined(CONFIG_USER_ONLY) && !defined(TARGET_WORDS_BIGENDIAN)
> +    if (!msr_le) {
> +        cpu_abort(CPU(cpu), "Cannot set QEMU to little-endian user mode\n");

We don't have this check the other way around, so why do we need it 
here? How do you ever get to this?


Alex

  parent reply	other threads:[~2014-05-13  7:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-10  9:16 [Qemu-devel] [PATCH v2 0/3] Adding new user mode target ppc64le-linux-user Doug Kwan
2014-05-10  9:16 ` [Qemu-devel] [PATCH v2 1/3] linux-user: Support little-endian PPC64 in user mode Doug Kwan
2014-05-10  9:55   ` Peter Maydell
2014-05-10 10:02   ` Peter Maydell
2014-05-10  9:16 ` [Qemu-devel] [PATCH v2 2/3] PPC: Allow little-endian " Doug Kwan
2014-05-10 10:13   ` Peter Maydell
2014-05-13  7:05   ` Alexander Graf [this message]
2014-05-13  7:30     ` Doug Kwan (關振德)
2014-05-13  7:32       ` Alexander Graf
2014-05-10  9:16 ` [Qemu-devel] [PATCH v2 3/3] Add a new user mode target for little-endian PPC64 Doug Kwan
2014-05-10 10:00   ` Peter Maydell
2014-05-12 13:05   ` Tom Musta
2014-05-13  6:45     ` Doug Kwan (關振德)
2014-05-13  7:06 ` [Qemu-devel] [PATCH v2 0/3] Adding new user mode target ppc64le-linux-user Alexander Graf
2014-05-13 12:08   ` [Qemu-devel] [Qemu-ppc] " Tom Musta

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=5371C44E.8010901@suse.de \
    --to=agraf@suse.de \
    --cc=dougkwan@google.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=riku.voipio@iki.fi \
    /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).