From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55072) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4SVj-0001cE-5h for qemu-devel@nongnu.org; Tue, 08 Jul 2014 06:20:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X4SVX-0007pN-EJ for qemu-devel@nongnu.org; Tue, 08 Jul 2014 06:20:31 -0400 From: Alexander Graf Date: Tue, 8 Jul 2014 12:20:12 +0200 Message-Id: <1404814818-15101-3-git-send-email-agraf@suse.de> In-Reply-To: <1404814818-15101-1-git-send-email-agraf@suse.de> References: <1404814818-15101-1-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PULL 2/8] target-ppc: Change default cpu for ppc64le-linux-user List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: peter.maydell@linaro.org Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Richard Henderson From: Richard Henderson The default, 970fx, doesn't support MSR_LE. So even though we set LE in ppc_cpu_reset, it gets cleared again in hreg_store_msr. Error out if a user-selected cpu model doesn't support LE. Signed-off-by: Richard Henderson [agraf: switch to POWER7 as default for BE and LE] Signed-off-by: Alexander Graf --- linux-user/main.c | 8 ++++---- target-ppc/translate_init.c | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/linux-user/main.c b/linux-user/main.c index 900a17f..b453a39 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -3901,11 +3901,11 @@ int main(int argc, char **argv, char **envp) #elif defined TARGET_OPENRISC cpu_model = "or1200"; #elif defined(TARGET_PPC) -#ifdef TARGET_PPC64 - cpu_model = "970fx"; -#else +# ifdef TARGET_PPC64 + cpu_model = "POWER7"; +# else cpu_model = "750"; -#endif +# endif #else cpu_model = "any"; #endif diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c index 2ab2810..7b4d9be 100644 --- a/target-ppc/translate_init.c +++ b/target-ppc/translate_init.c @@ -9551,6 +9551,10 @@ static void ppc_cpu_reset(CPUState *s) #endif #if !defined(TARGET_WORDS_BIGENDIAN) msr |= (target_ulong)1 << MSR_LE; /* Little-endian user mode */ + if (!((env->msr_mask >> MSR_LE) & 1)) { + fprintf(stderr, "Selected CPU does not support little-endian.\n"); + exit(1); + } #endif #endif -- 1.8.1.4