From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52900) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wk6ml-0006BD-V6 for qemu-devel@nongnu.org; Tue, 13 May 2014 03:06:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wk6me-0001qF-Er for qemu-devel@nongnu.org; Tue, 13 May 2014 03:05:59 -0400 Message-ID: <5371C44E.8010901@suse.de> Date: Tue, 13 May 2014 09:05:50 +0200 From: Alexander Graf MIME-Version: 1.0 References: <1399713400-8619-1-git-send-email-dougkwan@google.com> <1399713400-8619-3-git-send-email-dougkwan@google.com> In-Reply-To: <1399713400-8619-3-git-send-email-dougkwan@google.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 2/3] PPC: Allow little-endian user mode. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Doug Kwan , qemu-devel@nongnu.org, qemu-ppc@nongnu.org Cc: riku.voipio@iki.fi 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 > --- > 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