qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] linux-user mmap() for 32-bit guest on 64-bit host


From: Thayne Harbaugh
Subject: [Qemu-devel] linux-user mmap() for 32-bit guest on 64-bit host
Date: Thu, 27 Sep 2007 22:56:48 -0600

I've been using the patch posted by Kirill Shutemov
(http://www.mail-archive.com/address@hidden/msg10893.html) for
forcing mmap() addresses on 64-bit hosts to be 32-bit clean.  I just
discovered a minor problem with the patch: MAP_32BIT is not a valid flag
to mremap() and will cause mremap() to be rejected by the kernel with
EINVAL.

I've investigated the kernel and it doesn't preserve the flags from the
original mmap() call.  Essentially do_mremap() in the kernel calls
get_unmapped_area() with the only possible flag being MAP_SHARED.

The attached patch fixes qemu so that mremap() won't get rejected for
having an illegal flag, but it might cause havoc for allocating a
>32-bit address.

A possible patch for the kernel is also included (and untested).

Attachment: 38_mmap_32bit.patch
Description: Text Data

Attachment: linux-mremap_map_32bit.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]