linux-user: fix 32bit g2h()/h2g()
commit3e23de15237c81fe7af7c3ffa299a6ae5fec7d43
authorLaurent Vivier <laurent@vivier.eu>
Tue, 14 Aug 2018 17:12:17 +0000 (14 19:12 +0200)
committerLaurent Vivier <laurent@vivier.eu>
Fri, 17 Aug 2018 11:56:33 +0000 (17 13:56 +0200)
tree41b0808ca14091f7d436b1bd4c72c7065d24c263
parentb8dbfc9cc662ba05ea0b8ffc4598e422b76fbcbd
linux-user: fix 32bit g2h()/h2g()

sparc32plus has 64bit long type but only 32bit virtual address space.

For instance, "apt-get upgrade" failed because of a mmap()/msync()
sequence.

mmap() returned 0xff252000 but msync() used g2h(0xffffffffff252000)
to find the host address. The "(target_ulong)" in g2h() doesn't fix the
address because it is 64bit long.

This patch introduces an "abi_ptr" that is set to uint32_t
if the virtual address space is addressed using 32bit in the linux-user
case. It stays set to target_ulong with softmmu case.

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20180814171217.14680-1-laurent@vivier.eu>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
[lv: added "%" in TARGET_ABI_FMT_ptr "%"PRIx64]
include/exec/cpu_ldst.h
include/exec/cpu_ldst_useronly_template.h
linux-user/syscall.c