From nobody Thu Dec 18 22:25:27 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.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=1569602498; cv=none; d=zoho.com; s=zohoarc; b=ThxJKPjk0B+Wdy5wF3+LkEO672JpRiV2wIuCqHtL2imid9m1rIlw+dJype7bKbJfOgAwMHnS1YsqJZEJCsdBFT22zHMcAQlV7iaqq/b3wTHI/D6ytUovCyF4jasLJA/tsWkYbTiRp7tpMlVydJ9AS9fzlxyf/CnxKh6Pawp4DFc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569602498; h=Content-Type:Content-Transfer-Encoding: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:ARC-Authentication-Results; bh=Nfr1PbQT0Jo9Bvco8Z/MdDyJj7lbe3iyjg+htmYoZyk=; b=C66IdkvI2bY939Ap7dn3ycSFFUu865kGv9DKSJr/D3RHU1nfRk6yt39fhSf0iNCKl54L7PVqPH882FptWF6QpFzw6P6NznKs4yFY8uMOLMZ58We7arOws3Xipf3X5T43OfoMGkwtxLH6eeXwXJtBK++rE3brLfxIuTi1FfqONmM= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.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 1569602498390797.3542214902453; Fri, 27 Sep 2019 09:41:38 -0700 (PDT) Received: from localhost ([::1]:53464 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iDtJH-0006vb-Mt for importer@patchew.org; Fri, 27 Sep 2019 12:41:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51277) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iDrSg-0002Wy-Os for qemu-devel@nongnu.org; Fri, 27 Sep 2019 10:43:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iDrSd-00089u-7P for qemu-devel@nongnu.org; Fri, 27 Sep 2019 10:43:09 -0400 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:35097) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iDrSb-00087x-5j for qemu-devel@nongnu.org; Fri, 27 Sep 2019 10:43:05 -0400 Received: by mail-wr1-x442.google.com with SMTP id v8so3153945wrt.2 for ; Fri, 27 Sep 2019 07:43:01 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id y12sm2874539wrn.74.2019.09.27.07.42.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Sep 2019 07:42:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=Nfr1PbQT0Jo9Bvco8Z/MdDyJj7lbe3iyjg+htmYoZyk=; b=lvZ7kUgPYDeisfp8Kul6oDEt308mX3gDVEeShL3OAvE0ikqkAM78ZqzEOwcS8/2q1V H3/UuVhse+sKqC+yTesLgflqc5LaZAqxufUUoUJXiOCOb3QCuDC9SZIx8LLGcInOIv+J Gj96fSNInS+C96wNiBLHOFgSm5wdaUZmKbTDmsr2eXmgbnSPErKL86fJtigojUkXQHJg GCAxW9HgiD2jVeDV/BJCkFv2BLDjHxYSiaXx2/nwRovyKU1Yh1C1F4EiPu8RvR7Ly1AR se98U++rYmN/OcikJVbGTYsohB8JdhNJ91bhrtdT8bp6RYw6OY0IcRRgKoPiYyUY2C1J DDhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Nfr1PbQT0Jo9Bvco8Z/MdDyJj7lbe3iyjg+htmYoZyk=; b=eGVVZlqFz0Qi/EV20wTzX3i9knh0II3o2kuwsHAVNjZf2Xfaw/I0acDX33vbo7SrSg jfSoIW3iUw2+ofls+p2paKZSu2vyN5gZG03+iGem/trmuGiFhQJ6Py8gTuldzyjVIK8L fn2aIiw7DkLCyA1yO2b9m0pl3BUYlpjoO/3RmAL36AlOHzUtvLM1LpSmfU/TFnXl1sTi iLZp+P3WG2UIbiYPKRziV7vye8e6WQPlanLkpod2Hxj4SaGcHZ/fvqFWLh6Avz27NkhN hFd9kORhxJi4FS1KXe3KHDcy80AdZ+Sy8fVF/rQjNFJzv+U9nN+IzeqfruJcLcwH5Wfx 4H1g== X-Gm-Message-State: APjAAAWhY4/cxBjBefcosu8Drv8lBJ+jAYXBzu1xft3y7UshJziOyP+o rF/beBHgNXR8sNHJcdW5GvJr9MTX1GwAKw== X-Google-Smtp-Source: APXvYqzOSanJqfFoC3rXuZ4CzXmYdQ7qNdQZaqAo32D33UouQyfeVUaCrsKTr/UWYld91qNTo14BwA== X-Received: by 2002:a1c:2144:: with SMTP id h65mr7924062wmh.114.1569595380311; Fri, 27 Sep 2019 07:43:00 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 9/9] hw/arm/boot: Use the IEC binary prefix definitions Date: Fri, 27 Sep 2019 15:42:49 +0100 Message-Id: <20190927144249.29999-10-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190927144249.29999-1-peter.maydell@linaro.org> References: <20190927144249.29999-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::442 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) From: Philippe Mathieu-Daud=C3=A9 IEC binary prefixes ease code review: the unit is explicit. Reviewed-by: Richard Henderson Reviewed-by: Stefano Garzarella Reviewed-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20190923131108.21459-1-philmd@redhat.com Signed-off-by: Peter Maydell --- hw/arm/boot.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/arm/boot.c b/hw/arm/boot.c index 25422660545..c264864c11d 100644 --- a/hw/arm/boot.c +++ b/hw/arm/boot.c @@ -575,7 +575,7 @@ int arm_load_dtb(hwaddr addr, const struct arm_boot_inf= o *binfo, goto fail; } =20 - if (scells < 2 && binfo->ram_size >=3D (1ULL << 32)) { + if (scells < 2 && binfo->ram_size >=3D 4 * GiB) { /* This is user error so deserves a friendlier error message * than the failure of setprop_sized_cells would provide */ @@ -1097,7 +1097,7 @@ static void arm_setup_direct_kernel_boot(ARMCPU *cpu, * we might still make a bad choice here. */ info->initrd_start =3D info->loader_start + - MIN(info->ram_size / 2, 128 * 1024 * 1024); + MIN(info->ram_size / 2, 128 * MiB); if (image_high_addr) { info->initrd_start =3D MAX(info->initrd_start, image_high_addr); } @@ -1157,13 +1157,13 @@ static void arm_setup_direct_kernel_boot(ARMCPU *cp= u, * * Let's play safe and prealign it to 2MB to give us some = space. */ - align =3D 2 * 1024 * 1024; + align =3D 2 * MiB; } else { /* * Some 32bit kernels will trash anything in the 4K page t= he * initrd ends in, so make sure the DTB isn't caught up in= that. */ - align =3D 4096; + align =3D 4 * KiB; } =20 /* Place the DTB after the initrd in memory with alignment. */ @@ -1180,7 +1180,7 @@ static void arm_setup_direct_kernel_boot(ARMCPU *cpu, info->loader_start + KERNEL_ARGS_ADDR; fixupcontext[FIXUP_ARGPTR_HI] =3D (info->loader_start + KERNEL_ARGS_ADDR) >> 32; - if (info->ram_size >=3D (1ULL << 32)) { + if (info->ram_size >=3D 4 * GiB) { error_report("RAM size must be less than 4GB to boot" " Linux kernel using ATAGS (try passing a dev= ice tree" " using -dtb)"); --=20 2.20.1