|
From: | 關振德 |
Subject: | Re: [Qemu-ppc] [PATCH v2 2/3] PPC: Allow little-endian user mode. |
Date: | Tue, 13 May 2014 00:30:23 -0700 |
[...]
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 <address@hidden>
---
target-ppc/mem_helper.c | 25 ++++++--
target-ppc/translate.c | 150 +++++++++++++++++---------------------------
target-ppc/translate_init.c | 9 +++
3 files changed, 89 insertions(+), 95 deletions(-)
We don't have this check the other way around, so why do we need it here? How do you ever get to this?
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");
Alex
[Prev in Thread] | Current Thread | [Next in Thread] |