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

[xen staging] xen/arm: dom0less: cope with missing /gic phandle



commit 081683ea578da56dd20b9dc22a64d03c893b47ba
Author:     Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
AuthorDate: Fri Oct 11 17:19:56 2024 -0400
Commit:     Julien Grall <jgrall@xxxxxxxxxx>
CommitDate: Thu Oct 17 15:42:11 2024 +0100

    xen/arm: dom0less: cope with missing /gic phandle
    
    If a partial DT has a /gic node, but no references to it, dtc may omit
    the phandle property. With the phandle property missing,
    fdt_get_phandle() returns 0, leading Xen to generate a malformed domU
    dtb due to invalid interrupt-parent phandle references. 0 is an invalid
    phandle value. Add a zero check, and fall back to GUEST_PHANDLE_GIC.
    
    Signed-off-by: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
    Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
---
 xen/arch/arm/dom0less-build.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
index 09b65e44ae..f328a044e9 100644
--- a/xen/arch/arm/dom0less-build.c
+++ b/xen/arch/arm/dom0less-build.c
@@ -554,7 +554,10 @@ static int __init domain_handle_dtb_bootmodule(struct 
domain *d,
          */
         if ( dt_node_cmp(name, "gic") == 0 )
         {
-            kinfo->phandle_gic = fdt_get_phandle(pfdt, node_next);
+            uint32_t phandle_gic = fdt_get_phandle(pfdt, node_next);
+
+            if ( phandle_gic != 0 )
+                kinfo->phandle_gic = phandle_gic;
             continue;
         }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

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