summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2012-06-25 19:02:32 +0200
committerAnas Nashif <anas.nashif@intel.com>2013-01-15 13:33:22 -0800
commit692869063e7d5d75c97dcaa4ff80ba2ec5018688 (patch)
tree9c250044dbd78d45cae2eaf0a48b3531e7d4163e
parentea6856146977c33e6f1cc7459540eee436b457a1 (diff)
downloadqemu-692869063e7d5d75c97dcaa4ff80ba2ec5018688.tar.gz
qemu-692869063e7d5d75c97dcaa4ff80ba2ec5018688.tar.bz2
qemu-692869063e7d5d75c97dcaa4ff80ba2ec5018688.zip
linux-user: fix segmentation fault passing with g2h(x) != x
When forwarding a segmentation fault into the guest process, we were passing the host's address directly into the guest process's signal descriptor. That obviously confused the guest process, since it didn't know what to make of the (usually 32-bit truncated) address. Passing in g2h(address) makes the guest process a lot happier. This fixes java running in arm-linux-user for me. Signed-off-by: Alexander Graf <agraf@suse.de> [AF: Rebased onto AREG0 fix for v1.2, squashed fixup by agraf] Signed-off-by: Andreas Färber <afaerber@suse.de>
-rw-r--r--user-exec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/user-exec.c b/user-exec.c
index 1ec5d9af9..71afbf15f 100644
--- a/user-exec.c
+++ b/user-exec.c
@@ -98,6 +98,12 @@ static inline int handle_cpu_signal(uintptr_t pc, unsigned long address,
return 1;
}
+ if (RESERVED_VA) {
+ /* Convert forcefully to guest address space, invalid addresses
+ are still valid segv ones */
+ address = address - GUEST_BASE;
+ }
+
/* see if it is an MMU fault */
ret = cpu_handle_mmu_fault(cpu_single_env, address, is_write,
MMU_USER_IDX);