From patchwork Fri Apr 6 16:35:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 151252 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 141A2B7094 for ; Sat, 7 Apr 2012 05:13:56 +1000 (EST) Received: from localhost ([::1]:34421 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SGEUy-0007xX-5Z for incoming@patchwork.ozlabs.org; Fri, 06 Apr 2012 15:07:04 -0400 Received: from eggs.gnu.org ([208.118.235.92]:38346) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SGCI1-0004Y8-Gi for qemu-devel@nongnu.org; Fri, 06 Apr 2012 12:45:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SGCHz-0007Vi-ML for qemu-devel@nongnu.org; Fri, 06 Apr 2012 12:45:33 -0400 Received: from afflict.kos.to ([92.243.29.197]:59852) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SGC8A-0004wm-00 for qemu-devel@nongnu.org; Fri, 06 Apr 2012 12:35:22 -0400 Received: by afflict.kos.to (Postfix, from userid 1000) id E71832653D; Fri, 6 Apr 2012 16:35:17 +0000 (UTC) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Fri, 6 Apr 2012 19:35:11 +0300 Message-Id: <288e65b9eea0c9b3cbe21be46f3e24e4e8b2a090.1333729958.git.riku.voipio@linaro.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 92.243.29.197 X-Mailman-Approved-At: Fri, 06 Apr 2012 15:05:48 -0400 Cc: Alexander Graf Subject: [Qemu-devel] [PATCH 11/17] linux-user: reserve 4GB of vmem for 32-on-64 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 From: Alexander Graf When running 32-on-64 bit guests, we should always reserve as much virtual memory as we possibly can for the guest process, so it can never overlap with QEMU address space. Fortunately we already have the infrastructure for that. All that's missing is some sane default value to also make use of it! Signed-off-by: Alexander Graf Signed-off-by: Riku Voipio --- linux-user/main.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/linux-user/main.c b/linux-user/main.c index aa95db3..23ad357 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -48,8 +48,19 @@ unsigned long mmap_min_addr; #if defined(CONFIG_USE_GUEST_BASE) unsigned long guest_base; int have_guest_base; +#if (TARGET_LONG_BITS == 32) && (HOST_LONG_BITS == 64) +/* + * When running 32-on-64 we should make sure we can fit all of the possible + * guest address space into a contiguous chunk of virtual host memory. + * + * This way we will never overlap with our own libraries or binaries or stack + * or anything else that QEMU maps. + */ +unsigned long reserved_va = 0xf7000000; +#else unsigned long reserved_va; #endif +#endif static void usage(void);