Received: from eggs.gnu.org ([2001:4830:134:3::10]:37175) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGPEf-0004Tp-M3 for qemu-devel@nongnu.org; Mon, 02 Sep 2013 04:11:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VGPEX-0000fx-BH for qemu-devel@nongnu.org; Mon, 02 Sep 2013 04:11:45 -0400 From: Alexander Graf Date: Mon, 2 Sep 2013 10:11:18 +0200 Message-Id: <1378109493-41076-4-git-send-email-agraf@suse.de> In-Reply-To: <1378109493-41076-1-git-send-email-agraf@suse.de> References: <1378109493-41076-1-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PULL 03/18] target-ppc: USE LPCR_ILE to control exception endian on POWER7 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "qemu-ppc@nongnu.org list:PowerPC" Cc: Blue Swirl , Anthony Liguori , qemu-devel Developers , Aurelien Jarno , Anton Blanchard From: Anton Blanchard On POWER7, LPCR_ILE is used to control what endian guests take their exceptions in so use it instead of MSR_ILE. Signed-off-by: Anton Blanchard Reviewed-by: Anthony Liguori Signed-off-by: Alexander Graf --- target-ppc/cpu.h | 2 ++ target-ppc/excp_helper.c | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h index 711db08..422a6bb 100644 --- a/target-ppc/cpu.h +++ b/target-ppc/cpu.h @@ -453,6 +453,8 @@ struct ppc_slb_t { #define MSR_RI 1 /* Recoverable interrupt 1 */ #define MSR_LE 0 /* Little-endian mode 1 hflags */ +#define LPCR_ILE (1 << (63-38)) + #define msr_sf ((env->msr >> MSR_SF) & 1) #define msr_isf ((env->msr >> MSR_ISF) & 1) #define msr_shv ((env->msr >> MSR_SHV) & 1) diff --git a/target-ppc/excp_helper.c b/target-ppc/excp_helper.c index e9fcad8..e957761 100644 --- a/target-ppc/excp_helper.c +++ b/target-ppc/excp_helper.c @@ -611,9 +611,19 @@ static inline void powerpc_excp(PowerPCCPU *cpu, int excp_model, int excp) tlb_flush(env, 1); } +#ifdef TARGET_PPC64 + if (excp_model == POWERPC_EXCP_POWER7) { + if (env->spr[SPR_LPCR] & LPCR_ILE) { + new_msr |= (target_ulong)1 << MSR_LE; + } + } else if (msr_ile) { + new_msr |= (target_ulong)1 << MSR_LE; + } +#else if (msr_ile) { new_msr |= (target_ulong)1 << MSR_LE; } +#endif /* Jump to handler */ vector = env->excp_vectors[excp]; -- 1.8.1.4