Skip to content

Commit

Permalink
linux-user: Fix sub-host-page mmap
Browse files Browse the repository at this point in the history
We cannot skip over the_end1 to the_end, because we fail to
record the validity of the guest page with the interval tree.
Remove "the_end" and rename "the_end1" to "the_end".

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20240102015808.132373-19-richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed Feb 29, 2024
1 parent e8cec51 commit f0a362c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions linux-user/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ static abi_long target_mmap__locked(abi_ulong start, abi_ulong len,
target_prot, flags, fd, offset)) {
return -1;
}
goto the_end1;
goto the_end;
}
if (!mmap_frag(real_start, start,
real_start + host_page_size - 1,
Expand Down Expand Up @@ -690,7 +690,7 @@ static abi_long target_mmap__locked(abi_ulong start, abi_ulong len,
passthrough_last = real_last;
}
}
the_end1:
the_end:
if (flags & MAP_ANONYMOUS) {
page_flags |= PAGE_ANON;
}
Expand All @@ -708,7 +708,6 @@ static abi_long target_mmap__locked(abi_ulong start, abi_ulong len,
}
}
shm_region_rm_complete(start, last);
the_end:
trace_target_mmap_complete(start);
if (qemu_loglevel_mask(CPU_LOG_PAGE)) {
FILE *f = qemu_log_trylock();
Expand Down

0 comments on commit f0a362c

Please sign in to comment.