From patchwork Sat Mar 3 23:22:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 144466 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A5F80B6F9F for ; Sun, 4 Mar 2012 10:22:33 +1100 (EST) Received: from localhost ([::1]:41646 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3yHX-0008Eb-8X for incoming@patchwork.ozlabs.org; Sat, 03 Mar 2012 18:22:31 -0500 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 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 4A5AF90F2E; Sun, 4 Mar 2012 00:22:17 +0100 (CET) From: Alexander Graf To: qemu-devel qemu-devel Date: Sun, 4 Mar 2012 00:22:16 +0100 Message-Id: <1330816936-21772-1-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.7.3.4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 195.135.220.15 Cc: "Bernhard M. Wiedemann" , Riku Voipio , Paul Brook , Peter Maydell Subject: [Qemu-devel] [PATCH] linux-user: guard mmap_next_start from specific maps X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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