On 12/27/25 07:31, Jean-Christian CÎRSTEA wrote:
x86_64 defines MAP_32BIT which forces `mmap()` to return a 32-bit
address. This commit adds support for this flag if supported by the
host.
Signed-off-by: Jean-Christian CÎRSTEA<[email protected]>
---
include/user/abitypes.h | 2 ++
include/user/thunk.h | 3 ++
linux-user/strace.c | 26 ++++++++++++++++-
linux-user/strace.list | 4 +--
linux-user/syscall.c | 50 ++++++++++++++++-----------------
linux-user/x86_64/target_mman.h | 3 ++
6 files changed, 59 insertions(+), 29 deletions(-)
You can't just pass along MAP_32BIT to the host, even if it does support it. You need to
take guest_base into account, which may well place the low 4GB of the guest space well
above the low 4GB of the host address space.
Emulating this requires full control of the guest address space, which we don't usually
do. Though, see reserved_va.
r~