tools/libxl: arm: Use an higher value for the GIC phandle
authorJulien Grall <julien.grall@linaro.org>
Wed, 13 May 2015 18:33:39 +0000 (19:33 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 21 May 2015 14:12:08 +0000 (15:12 +0100)
The partial device tree may contains phandle. The Device Tree Compiler
tends to allocate the phandle from 1.

Reserve the ID 65000 for the GIC phandle. I think we can safely assume
that the partial device tree will never contain a such ID.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
docs/man/xl.cfg.pod.5
tools/libxl/libxl_arm.c
tools/libxl/libxl_types.idl

index ead8a5c03e1b58d6994e5b3fdb2e6871d5fd8a3b..fb8721faa3613ce1e2158157d0b0a9b8923269e9 100644 (file)
@@ -470,6 +470,9 @@ the user to defined aliases which can be used by the guest kernel.
 Given the complexity of verifying the validity of a device tree, this
 option should only be used with trusted device tree.
 
+Note that the partial device tree should avoid to use the phandle 65000
+which is reserved by the toolstack.
+
 =back
 
 =head2 Devices
index 71dbb9ee6390d16fbf5be1a89b36af000a536443..4fb5e26fab30fb9b6b982cd1151c3e3f5ccc2ee6 100644 (file)
@@ -81,10 +81,11 @@ static struct arch_info {
     {"xen-3.0-aarch64", "arm,armv8-timer", "arm,armv8" },
 };
 
-enum {
-    PHANDLE_NONE = 0,
-    PHANDLE_GIC,
-};
+/*
+ * The device tree compiler (DTC) is allocating the phandle from 1 to
+ * onwards. Reserve a high value for the GIC phandle.
+ */
+#define PHANDLE_GIC (65000)
 
 typedef uint32_t be32;
 typedef be32 gic_interrupt[3];
index 4ea1290647b7f6db1ae4267801d75dcea08e6e68..f1c62edfe0910e7f5696b088195ef55d867a50bc 100644 (file)
@@ -416,6 +416,8 @@ libxl_domain_build_info = Struct("domain_build_info",[
     # Given the complexity of verifying the validity of a device tree,
     # libxl doesn't do any security check on it. It's the responsibility
     # of the caller to provide only trusted device tree.
+    # Note that the partial device tree should avoid to use the phandle
+    # 65000 which is reserved by the toolstack.
     ("device_tree",      string),
     ("u", KeyedUnion(None, libxl_domain_type, "type",
                 [("hvm", Struct(None, [("firmware",         string),