From: Will Deacon Date: Mon, 22 Apr 2013 17:28:55 +0000 (+0100) Subject: arm64: smp: honour #address-size when parsing CPU reg property X-Git-Tag: v3.10-rc1~44^2~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=72aea393a2e7c53a951bc581f18a79315f47036b;p=platform%2Fkernel%2Flinux-3.10.git arm64: smp: honour #address-size when parsing CPU reg property For systems where the top 32-bits of the MPIDR are all zero, we should allow the device-tree to specify an #address-size of 0x1 for the CPU reg property and then zero extend the value there. Without this patch, kvmtool breaks with the recent mpidr parsing code introduced in 4c7aa0021356 ("arm64: kernel: initialise cpu_logical_map from the DT"). Acked-by: Javi Merino Acked-by: Lorenzo Pieralisi Signed-off-by: Will Deacon Signed-off-by: Catalin Marinas --- diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index d4dcc65..a886194 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -270,6 +270,7 @@ void __init smp_init_cpus(void) bool bootcpu_valid = false; while ((dn = of_find_node_by_type(dn, "cpu"))) { + const u32 *cell; u64 hwid; /* @@ -277,10 +278,12 @@ void __init smp_init_cpus(void) * considered invalid to build a cpu_logical_map * entry. */ - if (of_property_read_u64(dn, "reg", &hwid)) { + cell = of_get_property(dn, "reg", NULL); + if (!cell) { pr_err("%s: missing reg property\n", dn->full_name); goto next; } + hwid = of_read_number(cell, of_n_addr_cells(dn)); /* * Non affinity bits must be set to 0 in the DT