Le 11/07/2018 à 18:40, Laurent Vivier a écrit : > The value given by mmap_find_vma_reserved() is used with mmap(), > so it is needed to be aligned with the host page size. > > Since commit 18e80c55bb, reserved_va is only aligned to TARGET_PAGE_SIZE, > and it works well if this size is greater or equal to the host page size. > > But ppc64 hosts have 64kB page size and when we start a 4kiB page size > guest (like i386), it fails when it tries to mmap the stack: > > mmap stack: Invalid argument > > Fixes: 18e80c55bb (linux-user: Tidy and enforce reserved_va initialization) > Signed-off-by: Laurent Vivier <laur...@vivier.eu>
Richard, I think this fix could be merged into your "linux-user: Fix shmat emulation by honoring host SHMLBA" patch, by adding something like this instead: --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -262,6 +262,8 @@ abi_ulong mmap_find_vma(abi_ulong start, abi_ulong size, abi_ulong align) abi_ulong addr; int wrapped, repeat; + align = MAX(align, qemu_host_page_size); + /* If 'start' == 0, then a default start address is used. */ if (start == 0) { start = mmap_next_start; Thanks, Laurent