From nobody Sun Feb 8 22:34:53 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582129080; cv=none; d=zohomail.com; s=zohoarc; b=nBKn2y2H6EoEzV0Cc2MIAGHVAyRZDIWnn2oYGs2Etd3ZdIFy+snMafwF9rTHk8B5ocxjD6YQ6Plb34e4jBk68EiorqYulyxC2VLvmz1Hnh0uQhRjsO7yvwwCDY/KTdOZHyfYEt5BrayFL3iQZhYZgBSMu/Ftwa2wtjuSzBB4k58= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582129080; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=1c2yqFgFbp4i9xhV4kKPq25gSYtbT55JAm+pKumo/54=; b=cqjR2veBQtMaOAZ2KDzwwsQMnwIOldtgnaHga1xMltSDlCF9zHNAztYE/4IGkwX2Zyjm66Rtl29L3JB1abjjkhOHyMFGgemZLDPXRVm4yHqPvnkNL0dXgYwb5XJ5NBbVX3Sc7j6sFde4upytpiG60ToVNWiDphqMy84WHVs83bE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1582129080459870.7328576145956; Wed, 19 Feb 2020 08:18:00 -0800 (PST) Received: from localhost ([::1]:55532 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j4S2x-0007dQ-Au for importer@patchew.org; Wed, 19 Feb 2020 11:17:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37192) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j4Rvd-0002d2-P2 for qemu-devel@nongnu.org; Wed, 19 Feb 2020 11:10:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j4RvY-0000bA-Og for qemu-devel@nongnu.org; Wed, 19 Feb 2020 11:10:25 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:51686 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j4RvY-0000av-LS for qemu-devel@nongnu.org; Wed, 19 Feb 2020 11:10:20 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-307-6l6MAIdJM4-F-t74eNuBaQ-1; Wed, 19 Feb 2020 11:10:15 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B60E918B5F6C; Wed, 19 Feb 2020 16:10:14 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq.redhat.com (dell-r430-03.lab.eng.brq.redhat.com [10.37.153.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id DDEF148; Wed, 19 Feb 2020 16:10:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582128620; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1c2yqFgFbp4i9xhV4kKPq25gSYtbT55JAm+pKumo/54=; b=d+Y+tsup1m/kDVkhbIKNhHJqybbw0i753GvU/HZy2ycUXPf5Lj/qfdHcBwsgvyovJ70MWs RiDDNpYge+D8vRVqDi/msNbndLt5c2mRTKVdXQ7Gz9IR0IncSjNVqUoG1Cg1Gr88sJwnSB xmvD1trL0reshik/tHJhg3HJFVw8+xk= From: Igor Mammedov To: qemu-devel@nongnu.org Subject: [PATCH v6 15/79] arm/imx25_pdk: drop RAM size fixup Date: Wed, 19 Feb 2020 11:08:49 -0500 Message-Id: <20200219160953.13771-16-imammedo@redhat.com> In-Reply-To: <20200219160953.13771-1-imammedo@redhat.com> References: <20200219160953.13771-1-imammedo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: 6l6MAIdJM4-F-t74eNuBaQ-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , richard.henderson@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" If user provided non-sense RAM size, board will complain and continue running with max RAM size supported. Also RAM is going to be allocated by generic code, so it won't be possible for board to fix things up for user. Make it error message and exit to force user fix CLI, instead of accepting non-sense CLI values. Signed-off-by: Igor Mammedov Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- v6: - use size_to_str() to print size (Richard Henderson ) CC: richard.henderson@linaro.org --- hw/arm/imx25_pdk.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/arm/imx25_pdk.c b/hw/arm/imx25_pdk.c index c76fc2bd94..c7c51d6cbc 100644 --- a/hw/arm/imx25_pdk.c +++ b/hw/arm/imx25_pdk.c @@ -32,6 +32,7 @@ #include "exec/address-spaces.h" #include "sysemu/qtest.h" #include "hw/i2c/i2c.h" +#include "qemu/cutils.h" =20 /* Memory map for PDK Emulation Baseboard: * 0x00000000-0x7fffffff See i.MX25 SOC fr support @@ -66,6 +67,7 @@ static struct arm_boot_info imx25_pdk_binfo; =20 static void imx25_pdk_init(MachineState *machine) { + MachineClass *mc =3D MACHINE_GET_CLASS(machine); IMX25PDK *s =3D g_new0(IMX25PDK, 1); unsigned int ram_size; unsigned int alias_offset; @@ -78,10 +80,10 @@ static void imx25_pdk_init(MachineState *machine) =20 /* We need to initialize our memory */ if (machine->ram_size > (FSL_IMX25_SDRAM0_SIZE + FSL_IMX25_SDRAM1_SIZE= )) { - warn_report("RAM size " RAM_ADDR_FMT " above max supported, " - "reduced to %x", machine->ram_size, - FSL_IMX25_SDRAM0_SIZE + FSL_IMX25_SDRAM1_SIZE); - machine->ram_size =3D FSL_IMX25_SDRAM0_SIZE + FSL_IMX25_SDRAM1_SIZ= E; + char *sz =3D size_to_str(mc->default_ram_size); + error_report("Invalid RAM size, should be %s", sz); + g_free(sz); + exit(EXIT_FAILURE); } =20 memory_region_allocate_system_memory(&s->ram, NULL, "imx25.ram", --=20 2.18.1