Skip to content

Commit

Permalink
target-ppc: USE LPCR_ILE to control exception endian on POWER7
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Anthony Liguori <[email protected]>
Signed-off-by: Alexander Graf <[email protected]>
  • Loading branch information
antonblanchard authored and agraf committed Sep 2, 2013
1 parent 7770b6f commit 1e0c7e5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions target-ppc/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 10 additions & 0 deletions target-ppc/excp_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 1e0c7e5

Please sign in to comment.