]> xenbits.xensource.com Git - people/julieng/xen-unstable.git/commitdiff
xen/arm: Warn when a device tree path will be re-used by Xen
authorJulien Grall <julien.grall@citrix.com>
Tue, 29 Sep 2015 16:21:37 +0000 (17:21 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 1 Oct 2015 12:51:39 +0000 (13:51 +0100)
Xen is unconditionally using certain device tree paths to create DOM0
specific node (for instance /psci, /memory and /hypervisor).

Print a warning message on the console to let the user know if we
re-use one of these nodes.

Note that the content of most of those is very common and they
should have already been skipped via the compatible string or type
string. This warning is here to catch unusual device-tree and
compatible string that we may not yet support in Xen.

Signed-off-by: Julien Grall <julien.grall@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/arm/domain_build.c

index e8f024f7830e85244308ea137e8392980c386fdb..eb93a3a4a700a56e771bae4d2d83acc24041de3d 100644 (file)
@@ -1205,6 +1205,13 @@ static int handle_node(struct domain *d, struct kernel_info *kinfo,
         DT_MATCH_TIMER,
         { /* sentinel */ },
     };
+    static const struct dt_device_match reserved_matches[] __initconst =
+    {
+        DT_MATCH_PATH("/psci"),
+        DT_MATCH_PATH("/memory"),
+        DT_MATCH_PATH("/hypervisor"),
+        { /* sentinel */ },
+    };
     struct dt_device_node *child;
     int res;
     const char *name;
@@ -1252,6 +1259,15 @@ static int handle_node(struct domain *d, struct kernel_info *kinfo,
         return 0;
     }
 
+    /*
+     * Xen is using some path for its own purpose. Warn if a node
+     * already exists with the same path.
+     */
+    if ( dt_match_node(reserved_matches, node) )
+        printk(XENLOG_WARNING
+               "WARNING: Path %s is reserved, skip the node as we may re-use the path.\n",
+               path);
+
     res = handle_device(d, node);
     if ( res)
         return res;