From patchwork Tue Oct 25 09:37:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Christophe Dubois X-Patchwork-Id: 9394221 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C18696077A for ; Tue, 25 Oct 2016 09:37:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AE656294CB for ; Tue, 25 Oct 2016 09:37:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A0C2B294CD; Tue, 25 Oct 2016 09:37:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9E049294CB for ; Tue, 25 Oct 2016 09:37:50 +0000 (UTC) Received: from localhost ([::1]:52923 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1byyB3-0003xX-Kb for patchwork-qemu-devel@patchwork.kernel.org; Tue, 25 Oct 2016 05:37:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54041) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1byyAi-0003v6-6P for qemu-devel@nongnu.org; Tue, 25 Oct 2016 05:37:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1byyAh-0003z0-2m for qemu-devel@nongnu.org; Tue, 25 Oct 2016 05:37:28 -0400 Received: from relay6-d.mail.gandi.net ([2001:4b98:c:538::198]:51541) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1byyAc-0003wP-IO; Tue, 25 Oct 2016 05:37:22 -0400 Received: from mfilter43-d.gandi.net (mfilter43-d.gandi.net [217.70.178.174]) by relay6-d.mail.gandi.net (Postfix) with ESMTP id 7E56BFB8F4; Tue, 25 Oct 2016 11:37:20 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter43-d.gandi.net Received: from relay6-d.mail.gandi.net ([IPv6:::ffff:217.70.183.198]) by mfilter43-d.gandi.net (mfilter43-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id uR6s5XHIBLUl; Tue, 25 Oct 2016 11:37:18 +0200 (CEST) X-Originating-IP: 78.235.240.156 Received: from localhost.localdomain (smm49-1-78-235-240-156.fbx.proxad.net [78.235.240.156]) (Authenticated sender: jcd@tribudubois.net) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 80E17FB91B; Tue, 25 Oct 2016 11:37:16 +0200 (CEST) From: Jean-Christophe Dubois To: qemu-arm@nongnu.org, peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Tue, 25 Oct 2016 11:37:11 +0200 Message-Id: <20161025093711.17407-1-jcd@tribudubois.net> X-Mailer: git-send-email 2.9.3 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4b98:c:538::198 Subject: [Qemu-devel] [PATCH] Versatile memory should not exceed 256MB. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jean-Christophe Dubois Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP For now Qemu accpet a memory size greater than 256 MB but it would crash afterward. Versatile devices are starting at 256 MB bondary. Signed-off-by: Jean-Christophe Dubois --- hw/arm/versatilepb.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c index 8ae5392..7f11651 100644 --- a/hw/arm/versatilepb.c +++ b/hw/arm/versatilepb.c @@ -198,6 +198,14 @@ static void versatile_init(MachineState *machine, int board_id) int done_smc = 0; DriveInfo *dinfo; + if (machine->ram_size > 0x10000000) { + /* devices are starting at address 0x10000000, + * Memory cannot overlap with devices. + */ + fprintf(stderr, "Memory size cannot exceed 256MB\n"); + exit(1); + } + if (!machine->cpu_model) { machine->cpu_model = "arm926"; }