Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1iCJwI-0003XP-5c for mharc-qemu-trivial@gnu.org; Mon, 23 Sep 2019 04:43:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48794) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCJwE-0003Sg-81 for qemu-trivial@nongnu.org; Mon, 23 Sep 2019 04:43:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCJwD-0006hl-0l for qemu-trivial@nongnu.org; Mon, 23 Sep 2019 04:43:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39762) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iCJwC-0006hZ-Pg for qemu-trivial@nongnu.org; Mon, 23 Sep 2019 04:43:16 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BF66B2A09BA for ; Mon, 23 Sep 2019 08:43:15 +0000 (UTC) Received: by mail-wm1-f71.google.com with SMTP id z205so6314600wmb.7 for ; Mon, 23 Sep 2019 01:43:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=RZ8TfihFLFp9ogn/VN3z57FhE0lipjbfgVMgo4BXLqI=; b=h5H5ATb5DjVgYIETNpfi4EVHAifum11HJJaipziRV6xAMWxXP74O2t5oGK8Q9vGOtn QAnENBvyEOvrSmxLLtWaW65BxykCCnUIRPvuftnZYkw9MzjYZdJm6mCYWWyxcDgjz2iG O2X/BT/N6sckp1rFXuAyiN/xbOD9Js7WF8sPitcqF/2O8wz+80tb4yQLl7BLB0keHaW7 rQxaoImylMjscfje8If9F5wE4fnmDsvxVTSNyzkEOA7ujUdzadsqBgSpu9JoR1L4Lbii 4EqDTRHC+R7qAHTZneuiyNiGA2cjltGoaTAj8/jRnHg4mzCSahs0iFrKfFq5rdF32JWY kAsQ== X-Gm-Message-State: APjAAAV9mn0MHHSA9hTscZKDnSo/lZ4J3INzEHtDqBQTHNIzput84JC4 6VhBfneqcqDS82S6OA48V2Tlwj6zU0Q/5S66Kar2z2/VaPepeNWaqMhI1WqvsjbApWZhcMFID0S YN9SJtLbZ7+1IZDKIQg== X-Received: by 2002:a05:600c:2412:: with SMTP id 18mr12278158wmp.128.1569228194524; Mon, 23 Sep 2019 01:43:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqzh5Dsh7lCmgMElQwKIcdcTwg3vHI378RhNCjA7e+DgtswSSab7CCNH19LkCShVhCZox92edw== X-Received: by 2002:a05:600c:2412:: with SMTP id 18mr12278143wmp.128.1569228194240; Mon, 23 Sep 2019 01:43:14 -0700 (PDT) Received: from [192.168.1.40] (240.red-88-21-68.staticip.rima-tde.net. [88.21.68.240]) by smtp.gmail.com with ESMTPSA id c18sm8776662wrv.10.2019.09.23.01.43.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 23 Sep 2019 01:43:13 -0700 (PDT) Subject: Re: [PATCH] hw/arm/boot: Use the IEC binary prefix definitions To: Stefano Garzarella Cc: qemu-devel@nongnu.org, qemu-trivial@nongnu.org, Peter Maydell , qemu-arm@nongnu.org References: <20190921103405.19623-1-philmd@redhat.com> <20190923082919.y2fjn2y6t7lire3z@steredhat> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Openpgp: id=89C1E78F601EE86C867495CBA2A3FD6EDEADC0DE; url=http://pgp.mit.edu/pks/lookup?op=get&search=0xA2A3FD6EDEADC0DE Message-ID: <75b5eaec-5e00-6dd0-1a67-b0dafd2d5622@redhat.com> Date: Mon, 23 Sep 2019 10:43:12 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190923082919.y2fjn2y6t7lire3z@steredhat> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 X-BeenThere: qemu-trivial@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Sep 2019 08:43:20 -0000 On 9/23/19 10:29 AM, Stefano Garzarella wrote: > On Sat, Sep 21, 2019 at 12:34:04PM +0200, Philippe Mathieu-Daud=C3=A9 w= rote: >> IEC binary prefixes ease code review: the unit is explicit. >> >> Signed-off-by: Philippe Mathieu-Daud=C3=A9 >> --- >> hw/arm/boot.c | 8 ++++---- >> 1 file changed, 4 insertions(+), 4 deletions(-) >> >> diff --git a/hw/arm/boot.c b/hw/arm/boot.c >> index bf97ef3e33..59bb2fa0d3 100644 >> --- a/hw/arm/boot.c >> +++ b/hw/arm/boot.c >=20 > Very appreciated! >=20 > What about fixing also this other line? >=20 > @@ -575,7 +575,7 @@ int arm_load_dtb(hwaddr addr, const struct arm_boot= _info *binfo, > goto fail; > } > =20 > - if (scells < 2 && binfo->ram_size >=3D (1ULL << 32)) { > + if (scells < 2 && binfo->ram_size >=3D 4 * GiB) { Good idea! > /* This is user error so deserves a friendlier error message > * than the failure of setprop_sized_cells would provide >=20 >=20 >> @@ -1095,7 +1095,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_add= r); >> } >> @@ -1155,13 +1155,13 @@ static void arm_setup_direct_kernel_boot(ARMCP= U *cpu, >> * >> * 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 p= age the >> * 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 alignmen= t. */ >> @@ -1178,7 +1178,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 device tree" >> " using -dtb)"); >=20 > With or without the new line fix: >=20 > Acked-by: Stefano Garzarella Did you mean Reviewed-by? Regards, Phil.