Skip to contentSkip to conversation

bootfdt: Unify early printing of memory ranges endpoints

PATCH In review Michal Orzel 3 participants 4 messages Nov 19, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bootfdt: Unify early printing of memory ranges endpoints

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.

---
 xen/common/device-tree/bootfdt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
xen/common/device-tree/bootfdt.c +2 -2
index 927f59c64b0d..480644b4b421 100644
@@ -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++ )
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw

Hi Michal,

Quoted 9 lines · Michal Orzel

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.

---

Looks good to me!

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

#2 lore raw
Quoted 14 lines · Luca Fancellu

Hi Michal,

Quoted 9 lines · Michal Orzel

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.

---

Quoted 7 lines

Looks good to me!

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

#3 lore raw
In reply to Luca Fancellu
Quoted 9 lines · Luca Fancellu

Hi Michal,

Quoted 7 lines · Michal Orzel

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.

Quoted 6 lines
Quoted 2 lines

---

Looks good to me!