From patchwork Wed Jul 20 18:17:44 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 105988 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 06F12B6F7E for ; Thu, 21 Jul 2011 16:53:00 +1000 (EST) Received: from localhost ([::1]:48142 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjdzB-0000my-QY for incoming@patchwork.ozlabs.org; Wed, 20 Jul 2011 17:07:17 -0400 Received: from eggs.gnu.org ([140.186.70.92]:34225) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjbTY-0005sf-V1 for qemu-devel@nongnu.org; Wed, 20 Jul 2011 14:26:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QjbTU-0001ys-Lg for qemu-devel@nongnu.org; Wed, 20 Jul 2011 14:26:28 -0400 Received: from smtp.citrix.com ([66.165.176.89]:50601) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjbLO-0000KS-Ed for qemu-devel@nongnu.org; Wed, 20 Jul 2011 14:18:02 -0400 X-IronPort-AV: E=Sophos;i="4.67,236,1309752000"; d="scan'208";a="15182519" Received: from ftlpmailmx01.citrite.net ([10.13.107.65]) by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5; 20 Jul 2011 14:18:02 -0400 Received: from smtp01.ad.xensource.com (10.219.128.104) by smtprelay.citrix.com (10.13.107.65) with Microsoft SMTP Server id 8.3.137.0; Wed, 20 Jul 2011 14:18:01 -0400 Received: from perard.uk.xensource.com (dhcp-3-28.uk.xensource.com [10.80.3.28] (may be forged)) by smtp01.ad.xensource.com (8.13.1/8.13.1) with ESMTP id p6KIHtvB009446; Wed, 20 Jul 2011 11:18:00 -0700 From: Anthony PERARD To: QEMU-devel , Alexander Graf Date: Wed, 20 Jul 2011 19:17:44 +0100 Message-ID: <1311185864-32745-4-git-send-email-anthony.perard@citrix.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1311185864-32745-1-git-send-email-anthony.perard@citrix.com> References: <1311185864-32745-1-git-send-email-anthony.perard@citrix.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 66.165.176.89 Cc: Anthony PERARD , Xen Devel , Stefano Stabellini Subject: [Qemu-devel] [PATCH V2 3/3] vl.c: Check the asked ram_size later. 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 As a Xen guest can have more than 2GB of RAM on a 32bit host, we move the conditions after than we now if we run one Xen or not. Signed-off-by: Anthony PERARD --- vl.c | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) diff --git a/vl.c b/vl.c index fcd7395..c2efedf 100644 --- a/vl.c +++ b/vl.c @@ -2433,11 +2433,6 @@ int main(int argc, char **argv, char **envp) exit(1); } - /* On 32-bit hosts, QEMU is limited by virtual address space */ - if (value > (2047 << 20) && HOST_LONG_BITS == 32) { - fprintf(stderr, "qemu: at most 2047 MB RAM can be simulated\n"); - exit(1); - } if (value != (uint64_t)(ram_addr_t)value) { fprintf(stderr, "qemu: ram size too large\n"); exit(1); @@ -3091,8 +3086,15 @@ int main(int argc, char **argv, char **envp) exit(1); /* init the memory */ - if (ram_size == 0) + if (ram_size == 0) { ram_size = DEFAULT_RAM_SIZE * 1024 * 1024; + } else if (!xen_enabled()) { + /* On 32-bit hosts, QEMU is limited by virtual address space */ + if (ram_size > (2047 << 20) && HOST_LONG_BITS == 32) { + fprintf(stderr, "qemu: at most 2047 MB RAM can be simulated\n"); + exit(1); + } + } /* init the dynamic translator */ cpu_exec_init_all(tb_size * 1024 * 1024);