From nobody Sat Nov 15 14:52:46 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=1751390146; cv=none; d=zohomail.com; s=zohoarc; b=PNjYPoJ7dYUSXuNW4WNCIie13x3mNtTlrrjLTRCzse0wsy5Hu6zJLmStUH68PqyTKKVkZ46KFhnNhCGVri0fPEechY/zqjNnaoUtngaSGCX1dTkX+eIxMZpkBA7lB2AA/X+AsPcUAoES2E/6oqlCkItyvnf8WZsgTUZPdCsBAig= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751390146; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=6rHpAA90Bjb+Ii0ByCKVJS29gi/VuqiHc6GuPotvdhc=; b=KyLj49YOYLDMCBFAwQghZf8zlhpPSArXSPY3sqL4ZHzA4kwdRzxAxSmgnGtJeAh0b3pJcuP7oyPCBKWo7v9ZCQOUxYdVCWLBse1AUMstNED1q9B24MBACjnK8LZ6ahDsTqN2k0CfZ6xcv93G2RZ+d2Hm4p2HISAv6TIm1P7zO0A= 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 1751390146202908.2788578919618; Tue, 1 Jul 2025 10:15:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uWeSj-0005mN-Rp; Tue, 01 Jul 2025 13:08:05 -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 1uWeSh-0005kH-6k for qemu-devel@nongnu.org; Tue, 01 Jul 2025 13:08:03 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uWeSf-0003iY-5L for qemu-devel@nongnu.org; Tue, 01 Jul 2025 13:08:02 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-3a548a73ff2so5264928f8f.0 for ; Tue, 01 Jul 2025 10:08:00 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a88c80bb28sm13475658f8f.43.2025.07.01.10.07.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jul 2025 10:07:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751389679; x=1751994479; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=6rHpAA90Bjb+Ii0ByCKVJS29gi/VuqiHc6GuPotvdhc=; b=UveNdawnhhnSKBo1rZxSMaV6HdJyYrbNWjWYsobfXFGHTlBL/m3KbHoDcKghZpE5Q4 5HUq4jQ8iF8hixrc8HJoJLtYsqinBG0B67F3rCDvLQtaz7vZzdoe/qRtAuxujXnahPib mXbAzvwVkEEPdhzadRbi+Uhwd1lnFd2jx37fDG4Z1uFMSeEBCQKN0YMVLv4YmO7apdm7 no6mCRpni7NhjQd5IySRgIxeBGPZ6f9UdCM90RJ4ivPIHRvIKp7r+QD0Iqwb1ECjcHcT VEwykzjb34x/fmtPyPmhn1LfamqGMpwmAkc4nKz66zO7jI5GNMXX9XsPlTOqmQliRQDK pxhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751389679; x=1751994479; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6rHpAA90Bjb+Ii0ByCKVJS29gi/VuqiHc6GuPotvdhc=; b=kPoEHbZZq221/MUQQrmJLxxaVWyiGZVDcp0j6Vg/HWkOGGTw7YZrYRMh0KmfSx7otk q6g0dybMmlRIy33X83aORHAw+XPppuRB560UhkPnBANmNRPa58/B1QSrXuNRj+fwWrx/ a1Jn+LM0tkIyOWY3qhLixQ8wBlHi8CCq+ROWC3xvBAQc9q8Y52MNN4xvtwNy8Z5MiOd0 nC6zYO/S0/Dqz+QNboacvVXcKCJIGeLOm4utef11ijqs43dLhl8k12x2wwiI3qu4FvNh bDPo7WNbYBqgGISfNLgdDslX7iDptu4Mro7qIPFmFqmpD6WEGbhxSsQC+rqkooJhDx8l Gq7w== X-Gm-Message-State: AOJu0YxuHISog5HHmcBC02Tn1MhRgvMZfL1B4egtnAC9w58R66T/jbhk rMvQl3t2Szpo7sgIZpdhPuVIRmJ+HV9GWgHV9dig5jwt/da50cajfcD0PF3XSThm+OuLfeaZS7T VCvlM X-Gm-Gg: ASbGncvAi6Jy3lVNp895oBKxdLA0JALjHUL0zJ1aOiNJRUzdT4FfRR+jMHcSyO+6sOg ku57PGTvLDYvG+fLR46j5VXDBLHqRYe3MOUTOFtJGmWKGPPOTxvn6D37G9LMhrThgwpmWvHAZ+I ZB5opr7nGhyR1GNixC5gE1gnPHFyFan+Xp7DqYKWsaYXChNFHaWOsfBid37bC3eUOcGEn+wF9av 80kkY+DaGD24qRGHAoTKcuoLjZ/K6078SNjHZs10jsZlOB7NiFlMaZGNCWgNVDRf3f8mY7YYnpD I02XN1H3Z1I3OAfVuxkJXinhJ4978+kbcaIGKh6Qxfn4l2tUwFyBhoCugyMCau8oFYHC X-Google-Smtp-Source: AGHT+IEVi4r9bo9u4dEJdsJ2l1/K7SfRZ0sihlNpohm8SLtq4zvKzGbClB08cWrwVN28NTouI9ytBw== X-Received: by 2002:a05:6000:104e:b0:3a4:f513:7f03 with SMTP id ffacd0b85a97d-3a917bc827cmr13193667f8f.44.1751389678879; Tue, 01 Jul 2025 10:07:58 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 37/43] hw/arm/sbsa-ref: Tidy up use of RAMLIMIT_GB definition Date: Tue, 1 Jul 2025 18:07:13 +0100 Message-ID: <20250701170720.4072660-38-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250701170720.4072660-1-peter.maydell@linaro.org> References: <20250701170720.4072660-1-peter.maydell@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::435; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x435.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: 1751390148397116600 From: Philippe Mathieu-Daud=C3=A9 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 Message-id: 20250623121845.7214-22-philmd@linaro.org Signed-off-by: Peter Maydell --- 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.43.0