On 7/3/25 17:08, Richard Henderson wrote:
On 3/7/25 05:09, Philippe Mathieu-Daudé wrote:
Propagate the alignment to mmap_find_vma(), effectively
embedding mmap_find_vma_aligned() within mmap_find_vma().
Since we ignore the alignment in do_bsd_shmat(), leave a
FIXME comment.
Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org>
---
bsd-user/bsd-mem.h | 2 +-
bsd-user/qemu.h | 2 +-
bsd-user/mmap.c | 10 ++--------
3 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/bsd-user/bsd-mem.h b/bsd-user/bsd-mem.h
index f5ec0de24ca..87219da2919 100644
--- a/bsd-user/bsd-mem.h
+++ b/bsd-user/bsd-mem.h
@@ -372,7 +372,7 @@ static inline abi_long do_bsd_shmat(int shmid,
abi_ulong shmaddr, int shmflg)
} else {
abi_ulong mmap_start;
- mmap_start = mmap_find_vma(0, shm_info.shm_segsz);
+ mmap_start = mmap_find_vma(0, shm_info.shm_segsz, 0 /*
FIXME??? */);
It's not really ignoring the alignment, but not requiring alignment
above page size.
Traditionally, the alignment for shmat should be SHMLBA.
But in current freebsd sources,
sys/sys/shm.h:#define SHMLBA PAGE_SIZE /* Segment low boundary
address multiple */
there are no crazy broken old architectures to worry about.
OK, thank you for checking!