Commit Graph

9 Commits

Author SHA1 Message Date
Denis Drakhnia d15261fdd1 release
-----BEGIN PGP SIGNATURE-----
 
 iQFDBAABCAAtFiEEe3O61ovnosKJMUsicBtPaxppPlkFAmVccb4PHG1qdEB0bHMu
 bXNrLnJ1AAoJEHAbT2saaT5ZdcEIALhOJGKcYNjlJ5L1bJ/4mHi4oGsB8+hTHBrb
 Qz5ghcPC491Bp8N14z5ZiawgxtLdkgtPQ+Jm6Wufc84xC9YW+4mI+E1xs2uRMX4E
 dAQvwJcrCtuUm95qFQPGEX5+pIesMV4mmmD6LpKW477mJ1kgRfi45SQL0lVLT8bX
 f+fGuRgUbRiDL9a6qxJq7az5gubztuqry5CUFhoSgXIY2uf8ZHqxFVZkC0yOjmGn
 GO5jTAzpD3ZKEmzSbAcsLjxhv07UpEgG4U7I5Sn7MqkGq9asC8MFE8jiRo5iIzVm
 xN7OgJXv7/jQO4qUJNSg+a+hkyqLjXLgmzP07xN0+PNJ6p4cPSg=
 =IDI4
 -----END PGP SIGNATURE-----

Merge tag 'v8.1.3' into e2k-v8.1.3

 release
2023-12-06 15:32:22 +02:00
Richard Henderson da2b71fab6 linux-user: Define ELF_ET_DYN_BASE in $guest/target_mman.h
Copy each guest kernel's default value, then bound it
against reserved_va or the host address space.

Tested-by: Helge Deller <deller@gmx.de>
Reviewed-by: Helge Deller <deller@gmx.de>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2023-08-08 13:27:15 -07:00
Richard Henderson 2d708164e0 linux-user: Define TASK_UNMAPPED_BASE in $guest/target_mman.h
Provide default values that are as close as possible to the
values used by the guest's kernel.

Tested-by: Helge Deller <deller@gmx.de>
Reviewed-by: Helge Deller <deller@gmx.de>
Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2023-08-08 13:24:27 -07:00
Richard Henderson c8fb5cf97d linux-user: Adjust task_unmapped_base for reserved_va
Ensure that the chosen values for mmap_next_start and
task_unmapped_base are within the guest address space.

Tested-by: Helge Deller <deller@gmx.de>
Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2023-08-08 13:24:21 -07:00
Richard Henderson 62cbf08150 linux-user: Remove last_brk
This variable is unused.

Reviewed-by: Helge Deller <deller@gmx.de>
Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2023-08-06 16:46:13 -07:00
Richard Henderson 55baec0f4c linux-user: Widen target_mmap offset argument to off_t
We build with _FILE_OFFSET_BITS=64, so off_t = off64_t = uint64_t.
With an extra cast, this fixes emulation of mmap2, which could
overflow the computation of the full value of offset.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230707204054.8792-14-richard.henderson@linaro.org>
2023-07-15 08:02:32 +01:00
Ilya Leoshkevich 892a4f6a75 linux-user: Add partial support for MADV_DONTNEED
Currently QEMU ignores madvise(MADV_DONTNEED), which break apps that
rely on this for zeroing out memory [1]. Improve the situation by doing
a passthrough when the range in question is a host-page-aligned
anonymous mapping.

This is based on the patches from Simon Hausmann [2] and Chris Fallin
[3]. The structure is taken from Simon's patch. The PAGE_MAP_ANONYMOUS
bits are superseded by commit 26bab757d4 ("linux-user: Introduce
PAGE_ANON"). In the end the patch acts like the one from Chris: we
either pass-through the entire syscall, or do nothing, since doing this
only partially would not help the affected applications much. Finally,
add some extra checks to match the behavior of the Linux kernel [4].

[1] https://gitlab.com/qemu-project/qemu/-/issues/326
[2] https://patchew.org/QEMU/20180827084037.25316-1-simon.hausmann@qt.io/
[3] https://github.com/bytecodealliance/wasmtime/blob/v0.37.0/ci/qemu-madvise.patch
[4] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/mm/madvise.c?h=v5.19-rc3#n1368

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20220621144205.158452-1-iii@linux.ibm.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2022-06-24 10:00:00 +02:00
Denis Drakhnia f43cc408fb e2k: move e2k_psp_new to cpu.c
Signed-off-by: Denis Drakhnia <numas13@gmail.com>
2022-06-18 15:03:07 +03:00
Peter Maydell 5423e6d3a4 linux-user: Split mmap prototypes into user-mmap.h
Split out the mmap prototypes into a new header user-mmap.h
which we only include where required.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210908154405.15417-6-peter.maydell@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2021-09-13 20:35:45 +02:00