aboutsummaryrefslogtreecommitdiff
path: root/linux-user/mmap.c
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2019-05-19 13:19:53 -0700
committerLaurent Vivier <laurent@vivier.eu>2019-05-24 13:16:21 +0200
commit443b7505c6b04c5b7ab9611ac3ffd115fbf60cbf (patch)
tree5d5424515b042fa1a3ab12c489abdb947afb3b70 /linux-user/mmap.c
parent30ab9ef2967dde22193f609b6ec56101c156b061 (diff)
linux-user: Align mmap_find_vma to host page size
This can avoid stack allocation failures for i386 guest on ppc64 (64k page) host. Suggested-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20190519201953.20161-14-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'linux-user/mmap.c')
-rw-r--r--linux-user/mmap.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index 10796b37ac..af41339d57 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;