[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 16/18] linux-user: Tell guest about big host page siz
From: |
riku . voipio |
Subject: |
[Qemu-devel] [PULL 16/18] linux-user: Tell guest about big host page sizes |
Date: |
Mon, 9 Jun 2014 15:46:41 +0300 |
From: Alexander Graf <address@hidden>
We tell the guest its page size via AUX vectors. The guest process then uses
this page size as information on which boundaries it can mmap() things.
However, if the host has a bigger page size granularity than the guest, it can
not fulfill these mmap() requests - which falls apart when MAP_FIXED is passed
to mmap.
So in that case, let the guest know that we're running on a bigger page size
granularity than the target would require.
This fixes running qemu-ppc (TARGET_PAGE_SIZE=4k) on a 64k page size ppc64 host
for me.
Signed-off-by: Alexander Graf <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>
---
linux-user/elfload.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 995f999..03a8719 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -1531,7 +1531,7 @@ static abi_ulong create_elf_tables(abi_ulong p, int argc,
int envc,
NEW_AUX_ENT(AT_PHDR, (abi_ulong)(info->load_addr + exec->e_phoff));
NEW_AUX_ENT(AT_PHENT, (abi_ulong)(sizeof (struct elf_phdr)));
NEW_AUX_ENT(AT_PHNUM, (abi_ulong)(exec->e_phnum));
- NEW_AUX_ENT(AT_PAGESZ, (abi_ulong)(TARGET_PAGE_SIZE));
+ NEW_AUX_ENT(AT_PAGESZ, (abi_ulong)(MAX(TARGET_PAGE_SIZE, getpagesize())));
NEW_AUX_ENT(AT_BASE, (abi_ulong)(interp_info ? interp_info->load_addr :
0));
NEW_AUX_ENT(AT_FLAGS, (abi_ulong)0);
NEW_AUX_ENT(AT_ENTRY, info->entry);
--
2.0.0.rc2
- [Qemu-devel] [PULL 08/18] signal/all/do_sigreturn - remove __get_user checks, (continued)
- [Qemu-devel] [PULL 08/18] signal/all/do_sigreturn - remove __get_user checks, riku . voipio, 2014/06/09
- [Qemu-devel] [PULL 01/18] signal/all: remove __get/__put_user return value reading, riku . voipio, 2014/06/09
- [Qemu-devel] [PULL 18/18] User mode support for Linux ELF files with no section header, riku . voipio, 2014/06/09
- [Qemu-devel] [PULL 07/18] signal/all/do_sigaltstack remove __get_user value check, riku . voipio, 2014/06/09
- [Qemu-devel] [PULL 03/18] signal/all: remove return value from copy_siginfo_to_user, riku . voipio, 2014/06/09
- [Qemu-devel] [PULL 06/18] signal/sparc/restore_fpu_state: remove, riku . voipio, 2014/06/09
- [Qemu-devel] [PULL 05/18] signal/all: remove return value from restore_sigcontext, riku . voipio, 2014/06/09
- [Qemu-devel] [PULL 15/18] linux-user: Don't overrun guest buffer in sched_getaffinity, riku . voipio, 2014/06/09
- [Qemu-devel] [PULL 14/18] linux-user/uname: Return correct uname string for x86_64, riku . voipio, 2014/06/09
- [Qemu-devel] [PULL 11/18] signal/sparc64_set_context: remove __get_user checks, riku . voipio, 2014/06/09
- [Qemu-devel] [PULL 16/18] linux-user: Tell guest about big host page sizes,
riku . voipio <=
- [Qemu-devel] [PULL 04/18] signal/all: remove return value from setup_sigcontext, riku . voipio, 2014/06/09
- [Qemu-devel] [PULL 09/18] signal/all/setup_frame remove __put_user checks, riku . voipio, 2014/06/09
- Re: [Qemu-devel] [PULL 00/18] linux-user fixes, Peter Maydell, 2014/06/09