[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 22/33] linux-user: Split out mmap_h_lt_g
|
From: |
Ilya Leoshkevich |
|
Subject: |
Re: [PATCH v3 22/33] linux-user: Split out mmap_h_lt_g |
|
Date: |
Mon, 29 Jan 2024 16:26:38 +0100 |
On Tue, Jan 02, 2024 at 12:57:57PM +1100, Richard Henderson wrote:
> Work much harder to get alignment and mapping beyond the end
> of the file correct. Both of which are excercised by our
> test-mmap for alpha (8k pages) on any 4k page host.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> linux-user/mmap.c | 156 +++++++++++++++++++++++++++++++++++++---------
> 1 file changed, 125 insertions(+), 31 deletions(-)
[...]
> + if (fileend_adj) {
> + void *t = mmap(p, len - fileend_adj, host_prot,
> + (flags & ~MAP_FIXED_NOREPLACE) | MAP_FIXED,
> + fd, offset);
> + assert(t != MAP_FAILED);
Is it possible to recover here? Of course, we are remapping the memory
we've mapped a few lines earlier, but asserting the syscall result
looks a bit odd.
[...]
> + if (!(flags & MAP_ANONYMOUS)) {
> + void *t = mmap(p, len - fileend_adj, host_prot,
> + flags | MAP_FIXED, fd, offset);
> + assert(t != MAP_FAILED);
Same here.
- Re: [PATCH v3 21/33] linux-user: Split out mmap_h_eq_g, (continued)
- [PATCH v3 24/33] tests/tcg: Remove run-test-mmap-*, Richard Henderson, 2024/01/01
- [PATCH v3 20/33] linux-user: Do early mmap placement only for reserved_va, Richard Henderson, 2024/01/01
- [PATCH v3 22/33] linux-user: Split out mmap_h_lt_g, Richard Henderson, 2024/01/01
- [PATCH v3 23/33] linux-user: Split out mmap_h_gt_g, Richard Henderson, 2024/01/01
- [PATCH v3 26/33] *-user: Deprecate and disable -p pagesize, Richard Henderson, 2024/01/01
- [PATCH v3 27/33] cpu: Remove page_size_init, Richard Henderson, 2024/01/01
- [PATCH v3 25/33] tests/tcg: Extend file in linux-madvise.c, Richard Henderson, 2024/01/01