[PATCH] bootfdt: Unify early printing of memory ranges endpoints

Michal Orzel posted 1 patch 2 weeks, 3 days ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20241119115141.72770-1-michal.orzel@amd.com
xen/common/device-tree/bootfdt.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH] bootfdt: Unify early printing of memory ranges endpoints
Posted by Michal Orzel 2 weeks, 3 days ago
At the moment, when printing memory ranges during early boot, endpoints
of some ranges are printed as inclusive (RAM, RESVD, SHMEM) and some
as exclusive (Initrd, MODULE). Make the behavior consistent and print
all the endpoints as inclusive.

Signed-off-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/common/device-tree/bootfdt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/device-tree/bootfdt.c b/xen/common/device-tree/bootfdt.c
index 927f59c64b0d..480644b4b421 100644
--- a/xen/common/device-tree/bootfdt.c
+++ b/xen/common/device-tree/bootfdt.c
@@ -439,7 +439,7 @@ static int __init process_chosen_node(const void *fdt, int node,
         return -EINVAL;
     }
 
-    printk("Initrd %"PRIpaddr"-%"PRIpaddr"\n", start, end);
+    printk("Initrd %"PRIpaddr"-%"PRIpaddr"\n", start, end - 1);
 
     add_boot_module(BOOTMOD_RAMDISK, start, end-start, false);
 
@@ -524,7 +524,7 @@ static void __init early_print_info(void)
         printk("MODULE[%d]: %"PRIpaddr" - %"PRIpaddr" %-12s\n",
                 i,
                 mods->module[i].start,
-                mods->module[i].start + mods->module[i].size,
+                mods->module[i].start + mods->module[i].size - 1,
                 boot_module_kind_as_string(mods->module[i].kind));
 
     for ( i = 0; i < mem_resv->nr_banks; i++ )
-- 
2.25.1
Re: [PATCH] bootfdt: Unify early printing of memory ranges endpoints
Posted by Luca Fancellu 2 weeks, 3 days ago
Hi Michal,

> On 19 Nov 2024, at 11:51, Michal Orzel <michal.orzel@amd.com> wrote:
> 
> At the moment, when printing memory ranges during early boot, endpoints
> of some ranges are printed as inclusive (RAM, RESVD, SHMEM) and some
> as exclusive (Initrd, MODULE). Make the behavior consistent and print
> all the endpoints as inclusive.
> 
> Signed-off-by: Michal Orzel <michal.orzel@amd.com>
> ---

Looks good to me!

Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>

Outside early boot there are other places where we print exclusive ranges,
do you know if there is any general style we should apply or does it depend on
case by case?

Cheers,
Luca
Re: [PATCH] bootfdt: Unify early printing of memory ranges endpoints
Posted by Stefano Stabellini 2 weeks, 3 days ago
On Tue, 19 Nov 2024, Luca Fancellu wrote:
> Hi Michal,
> 
> > On 19 Nov 2024, at 11:51, Michal Orzel <michal.orzel@amd.com> wrote:
> > 
> > At the moment, when printing memory ranges during early boot, endpoints
> > of some ranges are printed as inclusive (RAM, RESVD, SHMEM) and some
> > as exclusive (Initrd, MODULE). Make the behavior consistent and print
> > all the endpoints as inclusive.
> > 
> > Signed-off-by: Michal Orzel <michal.orzel@amd.com>
> > ---
> 
> Looks good to me!
> 
> Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>

Acked-by: Stefano Stabellini <sstabellini@kernel.org>
Re: [PATCH] bootfdt: Unify early printing of memory ranges endpoints
Posted by Michal Orzel 2 weeks, 3 days ago

On 19/11/2024 14:32, Luca Fancellu wrote:
> 
> 
> Hi Michal,
> 
>> On 19 Nov 2024, at 11:51, Michal Orzel <michal.orzel@amd.com> wrote:
>>
>> At the moment, when printing memory ranges during early boot, endpoints
>> of some ranges are printed as inclusive (RAM, RESVD, SHMEM) and some
>> as exclusive (Initrd, MODULE). Make the behavior consistent and print
>> all the endpoints as inclusive.
>>
>> Signed-off-by: Michal Orzel <michal.orzel@amd.com>
>> ---
> 
> Looks good to me!
> 
> Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
> 
> Outside early boot there are other places where we print exclusive ranges,
> do you know if there is any general style we should apply or does it depend on
> case by case?
Yes, there are other places where we print ranges with endpoints exclusive or inclusive
but at least they are grouped together. Here it was quite confusing to find lines next to
each other with different styles. I don't think there is any specific style we should adhere to.

~Michal