[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/7] QEMU does not currently support host pages
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH 2/7] QEMU does not currently support host pages that are larger than guest pages, likely due to glibc using fixed mmap requests. |
Date: |
Sun, 19 Jun 2016 10:46:12 +0100 |
On 19 June 2016 at 01:11, Timothy Pearson
<address@hidden> wrote:
> Attempting to use host pages larger than the guest leads to
> alignment errors during ELF load in the best case, and an
> initialization failure inside NPTL in the worst case, causing
> all fork() requests inside the guest to fail.
>
> Warn when thread space cannot be set up, and suggest reducing
> host page size if applicable.
This is supposed to work -- for instance the linux-user/mmap.c
code has support for host pages and target pages not being the same.
In particular for ARM guests TARGET_PAGE_SIZE is 1K but the
host page size is 4K, so the config of "host page larger than
guest" isn't untested.
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -5482,8 +5482,13 @@ static int do_fork(CPUArchState *env, unsigned
> int flags, abi_ulong newsp,
> /* Wait for the child to initialize. */
> pthread_cond_wait(&info.cond, &info.mutex);
> ret = info.tid;
> - if (flags & CLONE_PARENT_SETTID)
> - put_user_u32(ret, parent_tidptr);
> + if (flags & CLONE_PARENT_SETTID) {
> + if (put_user_u32(ret, parent_tidptr)) {
> + fprintf(stderr, "do_fork: put_user_u32() failed,
> child process state invalid\n");
> + if (qemu_real_host_page_size > TARGET_PAGE_SIZE)
> + fprintf(stderr, "do_fork: host page size >
> target page size; reduce host page size and try again\n");
> + }
> + }
I think we should figure out why these put_user_u32() calls
are failing and fix them.
thanks
-- PMM