From patchwork Wed Dec 8 18:01:10 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 74891 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 5533BB6EF1 for ; Fri, 10 Dec 2010 00:55:07 +1100 (EST) Received: from localhost ([127.0.0.1]:47112 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQgxc-0004Ez-LU for incoming@patchwork.ozlabs.org; Thu, 09 Dec 2010 08:55:04 -0500 Received: from [140.186.70.92] (port=35027 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQOKe-0004P0-3W for qemu-devel@nongnu.org; Wed, 08 Dec 2010 13:01:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PQOKc-0008T2-RE for qemu-devel@nongnu.org; Wed, 08 Dec 2010 13:01:35 -0500 Received: from mx1.redhat.com ([209.132.183.28]:19288) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PQOKc-0008Sp-KF for qemu-devel@nongnu.org; Wed, 08 Dec 2010 13:01:34 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oB8I1Ibf031731 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 8 Dec 2010 13:01:18 -0500 Received: from doriath (ovpn-113-91.phx2.redhat.com [10.3.113.91]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id oB8I1EuS030822 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 8 Dec 2010 13:01:16 -0500 Date: Wed, 8 Dec 2010 16:01:10 -0200 From: Luiz Capitulino To: qemu-devel@nongnu.org Message-ID: <20101208160110.1b0c7c64@doriath> Organization: Red Hat Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: amit.shah@redhat.com, aliguori@us.ibm.com, ryanh@us.ibm.com, aurelien@aurel32.net Subject: [Qemu-devel] [PATCH] Fix segfault with ram_size > 4095M without kvm X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Currently, x86_64-softmmu qemu segfaults when trying to use > 4095M memsize. This patch adds a simple check and error message (much like the 2047 limit on 32-bit hosts) on ram_size in the control path after we determine we're not using kvm Upstream qemu-kvm is affected if using the -no-kvm option; this patch address the segfault there as well. Signed-off-by: Ryan Harper Signed-off-by: Aurelien Jarno --- NOTE: this patch was applied in the v0.12.x branch, but it seems it got lost for master vl.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/vl.c b/vl.c index 2dbb6db..bb9c21c 100644 --- a/vl.c +++ b/vl.c @@ -5792,6 +5792,12 @@ int main(int argc, char **argv, char **envp) fprintf(stderr, "failed to initialize KVM\n"); exit(1); } + } else { + /* without kvm enabled, we can only support 4095 MB RAM */ + if (ram_size > (4095UL << 20)) { + fprintf(stderr, "qemu: without kvm support at most 4095 MB RAM can be simulated\n"); + exit(1); + } } if (qemu_init_main_loop()) {