linux-user: ppc64: set MSR_CM bit for BookE 2.06 MMU
PATCH 1/1 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.
---
This is a kind of a v2 patch. The did the fix in the wrong place:
http://lists.nongnu.org/archive/html/qemu-devel/2016-07/msg05409.html
linux-user/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
linux-user/main.c +3 -2
@@ -4626,10 +4626,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;
Signature · 1 line
2.1.4
Quoted 6 lines · Michael Walle
64 bit user mode doesn't work for the e5500 core because the
MSR_CMbit 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 theMSR_CMbit for this MMU model.Signed-off-by Michael Walle <[email protected]>
Yup, I guess that's about as smart as we have to be :).
Alex
Quoted 26 lines
---
This is a kind of a v2 patch. The did the fix in the wrong place:
http://lists.nongnu.org/archive/html/qemu-devel/2016-07/msg05409.htmllinux-user/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)linux-user/main.c +3
-2@@ -4626,10 +4626,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;
Am 2016-07-22 17:57, schrieb Alexander Graf:
Quoted 6 lines · Michael Walle
Quoted 5 lines
64 bit user mode doesn't work for the e5500 core because the
MSR_CMbit 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 theMSR_CMbit for this MMU model.
Quoted 6 lines
Quoted 1 line
Signed-off-by Michael Walle <[email protected]>Yup, I guess that's about as smart as we have to be :).
Reviewed-by Alexander Graf <[email protected]>
ping?
-michael
Quoted 9 lines · Michael Walle
Am 2016-07-22 17:57, schrieb Alexander Graf:
Quoted 8 lines · Michael Walle
Quoted 7 lines
64 bit user mode doesn't work for the e5500 core because the
MSR_CMbit 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 theMSR_CMbit for this MMU model.
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
Signed-off-by Michael Walle <[email protected]>Yup, I guess that's about as smart as we have to be :).
Reviewed-by Alexander Graf <[email protected]>ping?
sorry. slipped through - looks good, but do we want this to qemu 2.7, or is next goot enough?
Riku
Am 2016-08-16 15:41, schrieb Riku Voipio:
Quoted 15 lines · Michael Walle
Quoted 14 lines
Am 2016-07-22 17:57, schrieb Alexander Graf:
Quoted 13 lines · Michael Walle
Quoted 8 lines
64 bit user mode doesn't work for the e5500 core because the
MSR_CMbit 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 theMSR_CMbit for this MMU model.Signed-off-by Michael Walle <[email protected]>Yup, I guess that's about as smart as we have to be :).
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Reviewed-by Alexander Graf <[email protected]>ping?
sorry. slipped through - looks good, but do we want this to qemu 2.7, or is next goot enough?
Hi Riku,
mhh, personally I would prefer to see it in 2.7, too, given that it is just a bugfix. But it only makes sense with the patch that I've just posted to the mailinglist ("linux-user: ppc64: fix ARCH_206 bit in AT_HWCAP"). Therefore, if it is too late for the latter, the first might also be just scheduled for next.
-michael
Am 2016-08-16 15:56, schrieb Michael Walle:
Quoted 23 lines
Am 2016-08-16 15:41, schrieb Riku Voipio:
Quoted 15 lines · Michael Walle
Quoted 14 lines
Am 2016-07-22 17:57, schrieb Alexander Graf:
Quoted 13 lines · Michael Walle
Quoted 8 lines
64 bit user mode doesn't work for the e5500 core because the
MSR_CMbit 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 theMSR_CMbit for this MMU model.Signed-off-by Michael Walle <[email protected]>Yup, I guess that's about as smart as we have to be :).
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Reviewed-by Alexander Graf <[email protected]>ping?
sorry. slipped through - looks good, but do we want this to qemu 2.7, or is next goot enough?
Quoted 7 lines
Hi Riku,
mhh, personally I would prefer to see it in 2.7, too, given that it is just a bugfix. But it only makes sense with the patch that I've just posted to the mailinglist ("linux-user: ppc64: fix
ARCH_206bit inAT_HWCAP"). Therefore, if it is too late for the latter, the first might also be just scheduled for next.
ping. this is still missing. Since David pulled the "linux-user: ppc64: fix ARCH_206 bit in AT_HWCAP" patch. This is the last missing piece to make yocto/ppc64 user-mode emulation work ;)
-michael
Riku Voipio
AppliedQuoted 32 lines · Michael Walle
Am 2016-08-16 15:56, schrieb Michael Walle:
Quoted 23 lines
Am 2016-08-16 15:41, schrieb Riku Voipio:
Quoted 15 lines · Michael Walle
Quoted 14 lines
Am 2016-07-22 17:57, schrieb Alexander Graf:
Quoted 13 lines · Michael Walle
Quoted 8 lines
64 bit user mode doesn't work for the e5500 core because the
MSR_CMbit 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 theMSR_CMbit for this MMU model.Signed-off-by Michael Walle <[email protected]>Yup, I guess that's about as smart as we have to be :).
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Reviewed-by Alexander Graf <[email protected]>ping?
sorry. slipped through - looks good, but do we want this to qemu 2.7, or is next goot enough?
Quoted 7 lines
Hi Riku,
mhh, personally I would prefer to see it in 2.7, too, given that it is just a bugfix. But it only makes sense with the patch that I've just posted to the mailinglist ("linux-user: ppc64: fix
ARCH_206bit inAT_HWCAP"). Therefore, if it is too late for the latter, the first might also be just scheduled for next.
Quoted 3 lines
ping. this is still missing. Since David pulled the "linux-user: ppc64: fix
ARCH_206bit inAT_HWCAP" patch. This is the last missing piece to make yocto/ppc64 user-mode emulation work ;)
Applied. thanks!
Riku