[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] xen/arm: Fix initrd placeholders generation in make_chosen_node()



commit ac547f0bedca85525b7dccc7acfbd58916407ccf
Author:     Michal Orzel <michal.orzel@xxxxxxx>
AuthorDate: Thu Aug 10 13:25:43 2023 +0200
Commit:     Stefano Stabellini <stefano.stabellini@xxxxxxx>
CommitDate: Thu Aug 10 19:29:02 2023 -0700

    xen/arm: Fix initrd placeholders generation in make_chosen_node()
    
    When booting a dom0less domU without initial ramdisk, it was observed
    that Xen still creates empty linux,initrd-{start,end} properties under
    /chosen node. This is because in make_chosen_node(), generation of initrd
    placeholders (later on filled with the real values) is protected with
    a check for presence of kernel bootmodule (always present) instead of
    initrd bootmodule. Fix it along with renaming the variable from "mod" to
    "initrd" to prevent similar mistakes in the future.
    
    Fixes: 48f4bf6bdeb4 ("arm/acpi: Create min DT stub for Dom0")
    Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
    Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx>
    Acked-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
---
 xen/arch/arm/domain_build.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 39b4ee03a5..c6881de8bd 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -2256,7 +2256,7 @@ int __init make_chosen_node(const struct kernel_info 
*kinfo)
 {
     int res;
     const char *bootargs = NULL;
-    const struct bootmodule *mod = kinfo->kernel_bootmodule;
+    const struct bootmodule *initrd = kinfo->initrd_bootmodule;
     void *fdt = kinfo->fdt;
 
     dt_dprintk("Create chosen node\n");
@@ -2276,7 +2276,7 @@ int __init make_chosen_node(const struct kernel_info 
*kinfo)
      * If the bootloader provides an initrd, we must create a placeholder
      * for the initrd properties. The values will be replaced later.
      */
-    if ( mod && mod->size )
+    if ( initrd && initrd->size )
     {
         u64 a = 0;
         res = fdt_property(kinfo->fdt, "linux,initrd-start", &a, sizeof(a));
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.