Received: from eggs.gnu.org ([208.118.235.92]:58782) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3yHN-00085m-Uf for qemu-devel@nongnu.org; Sat, 03 Mar 2012 18:22:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S3yHL-0003l5-UG for qemu-devel@nongnu.org; Sat, 03 Mar 2012 18:22:21 -0500 Received: from cantor2.suse.de ([195.135.220.15]:57232 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3yHL-0003kz-Nk for qemu-devel@nongnu.org; Sat, 03 Mar 2012 18:22:19 -0500 From: Alexander Graf Date: Sun, 4 Mar 2012 00:22:16 +0100 Message-Id: <1330816936-21772-1-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PATCH] linux-user: guard mmap_next_start from specific maps List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel qemu-devel Cc: "Bernhard M. Wiedemann" , Riku Voipio , Paul Brook , Peter Maydell If the guest process tells us to map at a specific address, we shouldn't increase the "last automatic mapping ended here" variable. This patch brings the reserved_va code in line with the default case. Signed-off-by: Alexander Graf --- linux-user/mmap.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/linux-user/mmap.c b/linux-user/mmap.c index 2245f40..a0c1347 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -253,7 +253,11 @@ static abi_ulong mmap_find_vma_reserved(abi_ulong start, abi_ulong size) } } } - mmap_next_start = addr; + + if (start == mmap_next_start && addr >= TASK_UNMAPPED_BASE) { + mmap_next_start = addr; + } + return last_addr; } #endif -- 1.6.0.2