summaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authorMichael Walle <michael@walle.cc>2016-07-22 17:18:05 +0200
committerRiku Voipio <riku.voipio@linaro.org>2016-09-21 21:42:11 +0300
commitc836112997e19966565cd6eb68e0836c8972720b (patch)
tree1fa7d09cae2e6fda8e0e2fcc9993dff97ed44c2c /linux-user
parentee8e76141b4dd00f8e97fda274876a17f9a46bbe (diff)
downloadqemu-c836112997e19966565cd6eb68e0836c8972720b.tar.gz
linux-user: ppc64: set MSR_CM bit for BookE 2.06 MMU
64 bit user mode doesn't work for the e5500 core because the MSR_CM bit is not set which enables the 64 bit mode for this MMU model. Memory addresses are truncated to 32 bit, which results in "Invalid data memory access" error messages. Fix it by setting the MSR_CM bit for this MMU model. Signed-off-by: Michael Walle <michael@walle.cc> Reviewed-by: Alexander Graf <agraf@suse.de> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/linux-user/main.c b/linux-user/main.c
index 3ad70f8a6e..2aeda8a10d 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -4615,10 +4615,11 @@ int main(int argc, char **argv, char **envp)
int i;
#if defined(TARGET_PPC64)
+ int flag = (env->insns_flags2 & PPC2_BOOKE206) ? MSR_CM : MSR_SF;
#if defined(TARGET_ABI32)
- env->msr &= ~((target_ulong)1 << MSR_SF);
+ env->msr &= ~((target_ulong)1 << flag);
#else
- env->msr |= (target_ulong)1 << MSR_SF;
+ env->msr |= (target_ulong)1 << flag;
#endif
#endif
env->nip = regs->nip;