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

[Xen-changelog] [xen master] xen/dts: Check the CPU ID is not greater than NR_CPUS



commit 7a35c108b35b7e008e5a2bf521b24515c5f8a910
Author:     Julien Grall <julien.grall@xxxxxxxxxx>
AuthorDate: Fri Sep 13 13:49:15 2013 +0100
Commit:     Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Tue Sep 17 15:28:08 2013 +0100

    xen/dts: Check the CPU ID is not greater than NR_CPUS
    
    On some board CPU IDs are not contiguous (for instance the Versatile Express
    with big.LITTLE supports). If the CPU ID is greater than NR_CPUS Xen will 
hang
    without any message. This is because console driver is not yet initialized 
and
    hypervisor data abort uses printk.
    
    For the moment check the CPU ID and print an warning if an error occured.
    
    Signed-off-by: Julien Grall <julien.grall@xxxxxxxxxx>
    Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 xen/common/device_tree.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 9d300ec..d2262ce 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -445,6 +445,13 @@ static void __init process_cpu_node(const void *fdt, int 
node,
 
     cpuid = dt_read_number((const __be32 *)prop->data, 1);
 
+    /* TODO: handle non-contiguous CPU ID */
+    if ( cpuid >= NR_CPUS )
+    {
+        dt_printk("fdt: node `%s': reg(0x%x) >= NR_CPUS(%d)\n",
+                  name, cpuid, NR_CPUS);
+        return;
+    }
     cpumask_set_cpu(cpuid, &cpu_possible_map);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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