bsd-user: Specify host page alignment if none specified
PATCH 1/1 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.
--- bsd-user/mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
bsd-user/mmap.c +1 -1
@@ -260,7 +260,7 @@ 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 : qemu_host_page_size)); } addr = start;
Signature · 1 line
2.40.0
Quoted 7 lines · Warner Losh
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 <[email protected]>--- bsd-user/mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
r~
Quoted 14 lines
bsd-user/mmap.c +1
-1@@ -260,7 +260,7 @@ 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 : qemu_host_page_size)); } addr = start;
Quoted 15 lines · Richard Henderson
Quoted 7 lines · Warner Losh
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 <[email protected]>---
bsd-user/mmap.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)Reviewed-by Richard Henderson <[email protected]>r~
Quoted 1 line
Quoted 9 lines
bsd-user/mmap.c static abi_ulong mmap_find_vma_aligned(abi_ulong start, abi_ulong size, · line 262
Quoted 9 lines
bsd-user/mmap.c +1
-1@@ -260,7 +260,7 @@ 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 : qemu_host_page_size));
Actually, it probably should be MAX(qemu_host_page_size, TARGET_PAGE_SIZE).
Does freebsd currently support any hosts with a page size that is not 4k? It would have been true in the past, certainly, but perhaps they've all been deprecated and removed.
r~
Quoted 27 lines · Richard Henderson
Quoted 12 lines · Richard Henderson
Quoted 7 lines · Warner Losh
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 <[email protected]>--- bsd-user/mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Reviewed-by Richard Henderson <[email protected]>Quoted 8 lines
r~
bsd-user/mmap.c static abi_ulong mmap_find_vma_aligned(abi_ulong
Quoted 6 lines
bsd-user/mmap.c +0
-0@@ -260,7 +260,7 @@ static abi_ulong mmap_find_vma_aligned(abi_ulongstart,
abi_ulongsize,Quoted 4 lines
bsd-user/mmap.c static abi_ulong mmap_find_vma_aligned(abi_ulong start, abi_ulong size, · line 263
Quoted 4 lines
bsd-user/mmap.c +1
-1if (reserved_va) {return mmap_find_vma_reserved (start, size, - (alignment !=0 ?1 << alignment :0 )); + (alignment !=0 ?1 << alignment : qemu_host_page_size));
Quoted 7 lines
Actually, it probably should be
MAX(qemu_host_page_size, TARGET_PAGE_SIZE).Does freebsd currently support any hosts with a page size that is not 4k? It would have
been true in the past, certainly, but perhaps they've all been deprecated and removed.
arm64 supports 64k pages now too... I'll update the patch...
Warner