diff options
author | Peter Maydell | 2017-11-06 19:33:24 +0100 |
---|---|---|
committer | Riku Voipio | 2017-11-07 20:58:43 +0100 |
commit | 15e692a6fc716f32976eea47946a4892e8ad7a3f (patch) | |
tree | 653cfd3f4c63840dd98b9b52a656e8fa7867447a /linux-user | |
parent | linux-user/s390x: Mask si_addr for SIGSEGV (diff) | |
download | qemu-15e692a6fc716f32976eea47946a4892e8ad7a3f.tar.gz qemu-15e692a6fc716f32976eea47946a4892e8ad7a3f.tar.xz qemu-15e692a6fc716f32976eea47946a4892e8ad7a3f.zip |
linux-user/ppc: Report correct fault address for data faults
For faults on loads and stores, ppc_cpu_handle_mmu_fault() in
target/ppc/user_only_helper.c stores the offending address
in env->spr[SPR_DAR]. Report this correctly to the guest
in si_addr, rather than incorrectly using the address of the
instruction that caused the fault.
This fixes the test case in
https://bugs.launchpad.net/qemu/+bug/1077116
for ppc, ppc64 and ppc64le.
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Diffstat (limited to 'linux-user')
-rw-r--r-- | linux-user/main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/linux-user/main.c b/linux-user/main.c index b6dd9efd2d..6286661bd3 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -1420,7 +1420,7 @@ void cpu_loop(CPUPPCState *env) info.si_code = TARGET_SEGV_MAPERR; break; } - info._sifields._sigfault._addr = env->nip; + info._sifields._sigfault._addr = env->spr[SPR_DAR]; queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); break; case POWERPC_EXCP_ISI: /* Instruction storage exception */ |