From nobody Sat Nov 15 15:29:55 2025 Delivered-To: importer@patchew.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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1750425010; cv=none; d=zohomail.com; s=zohoarc; b=ajWAWxSXWafMA526yVxBo++3h0mrOuyXK+0UxglzDxmRK4eqAMCmB6KpWsnWrkiTj2cbOUTXRNXgx/9vbEeqH+itO+SEcXFrK4b271W/J/dkuKeEaUvjhH8f2SGxmcfG+5u7uJRnGzeioNdvnQEseu8DYQtCj/OfAE0lB3UAes0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1750425010; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=tlzGRKm85UWY2+8yyhfs+sQBrY+hIXBP3ETvuuIJ2dg=; b=XX+Pm3se7koLa3WliistStrbIurZlrJ+EvdBLf3oVotY3BNp+F1s0KKGrKosW7mpZjz/SD54c3I6uDM4Cq4JEMgAkd/OsuWCle0g4zNVkk+uBn3x30w6jGZwmueRPlUAiGW1tOlWIn3odJmNGnfW/KLhn+T0FWBB7QLOeH6zyiI= 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) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1750425010190734.7289278366335; Fri, 20 Jun 2025 06:10:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uSbUj-00063g-5K; Fri, 20 Jun 2025 09:09:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uSbUe-00060Y-FC for qemu-devel@nongnu.org; Fri, 20 Jun 2025 09:09:20 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uSbUc-0004wU-HY for qemu-devel@nongnu.org; Fri, 20 Jun 2025 09:09:20 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-3a50fc819f2so1494930f8f.2 for ; Fri, 20 Jun 2025 06:09:17 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a6d2236452sm1791926f8f.59.2025.06.20.06.09.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Jun 2025 06:09:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1750424956; x=1751029756; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tlzGRKm85UWY2+8yyhfs+sQBrY+hIXBP3ETvuuIJ2dg=; b=Pht7qKYbs4PNh3+1sfSzreFNcmsSlficbWNgEYaQqnMWJ53RYjmk4ycvkeJn8SnAKp U4IKxlgwjv4ppwiiLvNSkjkoWRO0fHrqLjfM+MmYkIgo9q76syP1NOFY36uh2DMksbzQ cGyROTZianVReO27rd3vXGy5jnNx2p+aM7LBXJR91LkPPvV0Pfjb4jXcuAmKu5mfPVwJ eQUEpQI2sn6gLVMyPjq5G1YNYHwZMAjumEGddl/Rkk9q02NOSjdrZ1a446k/tz0n8kFS X81pjBD44jE07f2w7P9DEUzNXOTik9VQsMGaWnB2LHrqV4Gr9P2IdlvegGcyUnoEldhE ODVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750424956; x=1751029756; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tlzGRKm85UWY2+8yyhfs+sQBrY+hIXBP3ETvuuIJ2dg=; b=oS/udG7MJ4W+88Z5MLtxG5t/uIqC+Sxt1wc0t3JOa9dnD3z+dFJ8RMNnnJZbFVaOYD /24bIaDG3R63DWbTJheuGIGuzBS2dI7fApmt6z340tZtUnOPfawbyWZ96o/AYrcST+Hu 73wHUCy9T7e4nY9+Z4cAg8pgDF4WGDrYg537s8PiEqoyGfQ5DAZMdMN9dfv8o1aQEB95 it/W9TiRqbT6L4ugmxTtN5qKaSzlJrNrhNAwwIu4RLdfvDeSYPfW7M/iNna+jshwUmP2 zQCvUqUipfKz4Ef+XT+fS4cnCBA7COI5DZvxhg+mVOp6jGfCel3TeKS+xVRd7cr/VBvE bpdg== X-Gm-Message-State: AOJu0YzM4z5DuwwhLkdIncXEiRW7nHpCTHPumXhwsVY+7tkxxCC9e/Xt A0LNAIcZqxRg39ypb7MQsYdQMFtcKb9lD71nKLmtf9xNhJcAJWwbDOppAbUc1kcVabWp3Y99Rpv 8I+69cys= X-Gm-Gg: ASbGncsIA83Ym5x+DAYcSMeh4DCF5ozD27RWNsPXZo9zM2/QQ48+FsN0SgfpSMW0H/D +lmuC/yct9uWK215F8KoQ0fuYArKFVRuU0LQ3nAsClUymw/e9HSAQ54Jue5bO3ucJ0xColVEE7p C6GfLoFKDi1UF6Ss4zYupkTVR/fZMx/eZj6VvuSK72VCsQN1wqhB4nOqp1L/Kw+H6FafrVFhIRx s8VvNMgvDrzmBnZJnJLSStCZFyxNuqx91g5ge/vBfWPDZ5Knw1IqjgjyQuu/jEfuLfpIkpyvDJ4 VxSXdlWUi6JOgChO4VpQ+uhTSeySOh0vfT6rsaDz660YRN4+dQphsROUVOHSQq6BD34FjVUgy+l UFGo21PywnP4aAEJ5ygniprKHnis7RgB/8rFB X-Google-Smtp-Source: AGHT+IF5uD/3snOQ4X+aLRPk1Xt/Xd4ZmVTTd6N1+20oIyEGbROy1hmGwi9rA/PwtOTLyfKem3s2JA== X-Received: by 2002:a05:6000:248a:b0:3a5:2fae:1348 with SMTP id ffacd0b85a97d-3a6d13129c6mr2233188f8f.51.1750424956479; Fri, 20 Jun 2025 06:09:16 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Leif Lindholm , Richard Henderson , Radoslaw Biernacki , Alexander Graf , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Phil Dennis-Jordan , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Bernhard Beschow , Cleber Rosa , Peter Maydell , Cameron Esfahani , kvm@vger.kernel.org, qemu-arm@nongnu.org, Eric Auger , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Thomas Huth , Roman Bolshakov , John Snow Subject: [PATCH v2 22/26] hw/arm/sbsa-ref: Tidy up use of RAMLIMIT_GB definition Date: Fri, 20 Jun 2025 15:07:05 +0200 Message-ID: <20250620130709.31073-23-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250620130709.31073-1-philmd@linaro.org> References: <20250620130709.31073-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=philmd@linaro.org; helo=mail-wr1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1750425011059116600 Define RAMLIMIT_BYTES using the TiB definition and display the error parsed with size_to_str(): $ qemu-system-aarch64-unsigned -M sbsa-ref -m 9T qemu-system-aarch64-unsigned: sbsa-ref: cannot model more than 8 TiB of R= AM Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- hw/arm/sbsa-ref.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c index deae5cf9861..15c1ff4b140 100644 --- a/hw/arm/sbsa-ref.c +++ b/hw/arm/sbsa-ref.c @@ -19,6 +19,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/cutils.h" #include "qemu/datadir.h" #include "qapi/error.h" #include "qemu/error-report.h" @@ -53,8 +54,7 @@ #include "target/arm/cpu-qom.h" #include "target/arm/gtimer.h" =20 -#define RAMLIMIT_GB 8192 -#define RAMLIMIT_BYTES (RAMLIMIT_GB * GiB) +#define RAMLIMIT_BYTES (8 * TiB) =20 #define NUM_IRQS 256 #define NUM_SMMU_IRQS 4 @@ -756,7 +756,9 @@ static void sbsa_ref_init(MachineState *machine) sms->smp_cpus =3D smp_cpus; =20 if (machine->ram_size > sbsa_ref_memmap[SBSA_MEM].size) { - error_report("sbsa-ref: cannot model more than %dGB RAM", RAMLIMIT= _GB); + char *size_str =3D size_to_str(RAMLIMIT_BYTES); + + error_report("sbsa-ref: cannot model more than %s of RAM", size_st= r); exit(1); } =20 --=20 2.49.0