mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 14:53:54 -06:00
linux-user: fix segmentation fault passing with h2g(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 h2g(address) makes the guest process a lot happier. To make the code more obvious, introduce a h2g_nocheck() macro that does the same as h2g(), but allows us to convert addresses that may be outside of guest mapped range into the guest's view of address space. This fixes java running in arm-linux-user for me. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
This commit is contained in:
parent
82f05b69e6
commit
732f9e89a1
2 changed files with 10 additions and 2 deletions
|
@ -95,6 +95,10 @@ static inline int handle_cpu_signal(uintptr_t pc, unsigned long address,
|
|||
return 1;
|
||||
}
|
||||
|
||||
/* Convert forcefully to guest address space, invalid addresses
|
||||
are still valid segv ones */
|
||||
address = h2g_nocheck(address);
|
||||
|
||||
env = current_cpu->env_ptr;
|
||||
/* see if it is an MMU fault */
|
||||
ret = cpu_handle_mmu_fault(env, address, is_write, MMU_USER_IDX);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue