]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
bsd-user: Specify host page alignment if none specified
authorWarner Losh <imp@bsdimp.com>
Fri, 28 Jul 2023 16:29:27 +0000 (10:29 -0600)
committerRichard Henderson <richard.henderson@linaro.org>
Mon, 31 Jul 2023 19:19:13 +0000 (12:19 -0700)
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>
bsd-user/mmap.c

index 74ed00b9fe336f3bfbeb6104e055c78229452af0..b62a69bd07550051bd2357ce31f6d9870e7987ca 100644 (file)
@@ -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;