[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 19/60] linux-user: Adjust SVr4 NULL page mapping
From: |
Richard Henderson |
Subject: |
[PATCH 19/60] linux-user: Adjust SVr4 NULL page mapping |
Date: |
Fri, 1 Mar 2024 13:05:38 -1000 |
Use TARGET_PAGE_SIZE and MAP_FIXED_NOREPLACE.
We really should be attending to this earlier during
probe_guest_base, as well as better detection and
emulation of various Linux personalities.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20240102015808.132373-3-richard.henderson@linaro.org>
---
linux-user/elfload.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 38bfc9ac67..a51518f817 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -3912,8 +3912,9 @@ int load_elf_binary(struct linux_binprm *bprm, struct
image_info *info)
and some applications "depend" upon this behavior. Since
we do not have the power to recompile these, we emulate
the SVr4 behavior. Sigh. */
- target_mmap(0, qemu_host_page_size, PROT_READ | PROT_EXEC,
- MAP_FIXED | MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+ target_mmap(0, TARGET_PAGE_SIZE, PROT_READ | PROT_EXEC,
+ MAP_FIXED_NOREPLACE | MAP_PRIVATE | MAP_ANONYMOUS,
+ -1, 0);
}
#ifdef TARGET_MIPS
info->interp_fp_abi = interp_info.fp_abi;
--
2.34.1
- [PATCH 05/60] linux-user/elfload: Latch errno before cleanup in elf_core_dump, (continued)
- [PATCH 05/60] linux-user/elfload: Latch errno before cleanup in elf_core_dump, Richard Henderson, 2024/03/01
- [PATCH 08/60] linux-user/elfload: Lock cpu list and mmap during elf_core_dump, Richard Henderson, 2024/03/01
- [PATCH 11/60] linux-user/elfload: Write process memory to core file in larger chunks, Richard Henderson, 2024/03/01
- [PATCH 13/60] linux-user/elfload: Rely on walk_memory_regions for vmas, Richard Henderson, 2024/03/01
- [PATCH 15/60] tcg/aarch64: Apple does not align __int128_t in even registers, Richard Henderson, 2024/03/01
- [PATCH 16/60] accel/tcg: Set can_do_io at at start of lookup_tb_ptr helper, Richard Henderson, 2024/03/01
- [PATCH 06/60] linux-user/elfload: Open core file after vma_init, Richard Henderson, 2024/03/01
- [PATCH 09/60] linux-user/elfload: Size corefile before opening, Richard Henderson, 2024/03/01
- [PATCH 14/60] linux-user/elfload: Unprotect regions before core dump, Richard Henderson, 2024/03/01
- [PATCH 25/60] linux-user: Remove qemu_host_page_size from elf_core_dump, Richard Henderson, 2024/03/01
- [PATCH 19/60] linux-user: Adjust SVr4 NULL page mapping,
Richard Henderson <=
- [PATCH 12/60] linux-user/elfload: Simplify vma_dump_size, Richard Henderson, 2024/03/01
- [PATCH 18/60] accel/tcg: Remove qemu_host_page_size from page_protect/page_unprotect, Richard Henderson, 2024/03/01
- [PATCH 26/60] linux-user: Remove qemu_host_page_{size, mask} from mmap.c, Richard Henderson, 2024/03/01
- [PATCH 28/60] linux-user: Remove HOST_PAGE_ALIGN from mmap.c, Richard Henderson, 2024/03/01
- [PATCH 07/60] linux-user/elfload: Truncate core file on open, Richard Henderson, 2024/03/01
- [PATCH 20/60] linux-user: Remove qemu_host_page_{size, mask} in probe_guest_base, Richard Henderson, 2024/03/01
- [PATCH 23/60] linux-user/nios2: Remove qemu_host_page_size from init_guest_commpage, Richard Henderson, 2024/03/01
- [PATCH 27/60] linux-user: Remove REAL_HOST_PAGE_ALIGN from mmap.c, Richard Henderson, 2024/03/01
- [PATCH 35/60] linux-user: Move some mmap checks outside the lock, Richard Henderson, 2024/03/01
- [PATCH 37/60] linux-user: Split out mmap_end, Richard Henderson, 2024/03/01