From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47736) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCb3B-0002WC-Ry for qemu-devel@nongnu.org; Tue, 16 Oct 2018 21:55:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gCb3B-00071U-39 for qemu-devel@nongnu.org; Tue, 16 Oct 2018 21:55:05 -0400 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]:35131) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gCb3A-0006zx-NJ for qemu-devel@nongnu.org; Tue, 16 Oct 2018 21:55:04 -0400 Received: by mail-pl1-x643.google.com with SMTP id f8-v6so11891485plb.2 for ; Tue, 16 Oct 2018 18:55:04 -0700 (PDT) From: Richard Henderson Date: Tue, 16 Oct 2018 18:54:56 -0700 Message-Id: <20181017015456.3293-4-richard.henderson@linaro.org> In-Reply-To: <20181017015456.3293-1-richard.henderson@linaro.org> References: <20181017015456.3293-1-richard.henderson@linaro.org> Subject: [Qemu-devel] [PATCH 3/3] linux-user: Align mmap_find_vma to host page size List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: laurent@vivier.eu This can avoid stack allocation failures for i386 guest on ppc64 (64k page) host. Suggested-by: Laurent Vivier Signed-off-by: Richard Henderson --- linux-user/mmap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/linux-user/mmap.c b/linux-user/mmap.c index 47950ee9d7..735bc928fe 100644 --- 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; -- 2.17.2