qemu-e2k/linux-user
Paolo Bonzini 0c2d70c448 translate-all: ensure host page mask is always extended with 1's
Anthony reported that >4GB guests on Xen with 32bit QEMU broke after
commit 4ed023c ("Round up RAMBlock sizes to host page sizes", 2015-11-05).

In that patch sizes are masked against qemu_host_page_size/mask which
are uintptr_t, and thus 32bit on a 32bit QEMU, even though the ram space
might be bigger than 4GB on Xen.

Since ram_addr_t is not available on user-mode emulation targets, ensure
that we get a sign extension when masking away the low bits of the address.
Remove the ~10 year old scary comment that the type of these variables
is probably wrong, with another equally scary comment.  The new comment
however does not have "???" in it, which is arguably an improvement.

For completeness use the alignment macros in linux-user and bsd-user
instead of manually doing an &.  linux-user and bsd-user are not affected
by the Xen issue, however.

Reviewed-by: Juan Quintela <quintela@redhat.com>
Reported-by: Anthony PERARD <anthony.perard@citrix.com>
Fixes: 4ed023ce2a
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-12-02 13:12:30 +01:00
..
aarch64
alpha
arm
cris
i386
m68k
microblaze
mips
mips64
openrisc
ppc
s390x
sh4
sparc
sparc64
tilegx linux-user/tilegx: Implement tilegx signal features 2015-10-07 20:03:15 +11:00
unicore32
x86_64
elfload.c translate-all: ensure host page mask is always extended with 1's 2015-12-02 13:12:30 +01:00
errno_defs.h
flat.h
flatload.c linux-user: remove MAX_ARG_PAGES limit 2015-09-28 16:29:11 +03:00
ioctls.h
linux_loop.h
linuxload.c linux-user: remove MAX_ARG_PAGES limit 2015-09-28 16:29:11 +03:00
m68k-sim.c
main.c linux-user: Use g_new() & friends where that makes obvious sense 2015-10-08 19:46:47 +03:00
Makefile.objs
mmap.c translate-all: ensure host page mask is always extended with 1's 2015-12-02 13:12:30 +01:00
qemu.h linux-user: remove MAX_ARG_PAGES limit 2015-09-28 16:29:11 +03:00
signal.c linux-user/tilegx: Implement tilegx signal features 2015-10-07 20:03:15 +11:00
socket.h
strace.c
strace.list
syscall_defs.h linux-user/syscall_defs.h: Sync the latest si_code from Linux kernel 2015-10-07 20:03:15 +11:00
syscall_types.h
syscall.c linux-user/syscall: Replace g_malloc0 + memcpy with g_memdup 2015-11-06 15:42:38 +03:00
target_flat.h
uaccess.c
uname.c
uname.h
vm86.c