qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] linux-user: Align mmap memory to the target pag


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH] linux-user: Align mmap memory to the target page size.
Date: Fri, 15 Jan 2010 07:43:48 -0800
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091209 Fedora/3.0-4.fc12 Thunderbird/3.0

On 01/14/2010 04:38 PM, Richard Henderson wrote:
Previously, mmap_find_vma could return addresses not properly aligned
to the target page size.  This of course led to all sorts of odd
problems down the road.

The trivial fix, to simply reject the unaligned address and continue
searching the address space by increments of one page, is not a good
idea when there's a 64-bit address space involved.  The kernel may well
continue to return the last available address which we've already
rejected while we search upward from e.g. 2**42 from 2**64.

This patch uses a more complex search algorithm that takes the result
of the previous allocation into account.  We normally search upward,
but notice 2 consecutive results and start searching downward instead.

I've failed to take guest_base into account properly; my testing happened to have guest_base = 0. New patch to follow.


r~




reply via email to

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