aboutsummaryrefslogtreecommitdiff
path: root/bsd-user
diff options
context:
space:
mode:
authorWarner Losh <imp@bsdimp.com>2023-07-28 10:29:27 -0600
committerRichard Henderson <richard.henderson@linaro.org>2023-07-31 12:19:13 -0700
commit0f2f3247d456e08baa345768824dae6864d9acb6 (patch)
tree00c252acc82d06890345b583da4f225d29b3fdbc /bsd-user
parent28b61d49ac80bac8ef74aff0b75058bdd0b2f108 (diff)
bsd-user: Specify host page alignment if none specified
We're hitting an assert when we pass in alignment == 0 since that's not a power of two. so pass in the ideal page size. Signed-off-by: Warner Losh <imp@bsdimp.com> Message-Id: <20230728162927.5009-1-imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'bsd-user')
-rw-r--r--bsd-user/mmap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/bsd-user/mmap.c b/bsd-user/mmap.c
index 74ed00b9fe..b62a69bd07 100644
--- a/bsd-user/mmap.c
+++ b/bsd-user/mmap.c
@@ -260,7 +260,8 @@ static abi_ulong mmap_find_vma_aligned(abi_ulong start, abi_ulong size,
if (reserved_va) {
return mmap_find_vma_reserved(start, size,
- (alignment != 0 ? 1 << alignment : 0));
+ (alignment != 0 ? 1 << alignment :
+ MAX(qemu_host_page_size, TARGET_PAGE_SIZE)));
}
addr = start;