aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2013-04-22 13:28:55 -0400
committerCatalin Marinas <catalin.marinas@arm.com>2013-04-25 12:45:43 -0400
commit72aea393a2e7c53a951bc581f18a79315f47036b (patch)
tree107895e00c88eaa6a9468156185987c2e11cf52a /arch
parenta84b086b874e0c03ca456c1748df7031a8cdf957 (diff)
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 <javi.merino@arm.com> Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm64/kernel/smp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
index d4dcc6515253..a886194e58fd 100644
--- a/arch/arm64/kernel/smp.c
+++ b/arch/arm64/kernel/smp.c
@@ -270,6 +270,7 @@ void __init smp_init_cpus(void)
270 bool bootcpu_valid = false; 270 bool bootcpu_valid = false;
271 271
272 while ((dn = of_find_node_by_type(dn, "cpu"))) { 272 while ((dn = of_find_node_by_type(dn, "cpu"))) {
273 const u32 *cell;
273 u64 hwid; 274 u64 hwid;
274 275
275 /* 276 /*
@@ -277,10 +278,12 @@ void __init smp_init_cpus(void)
277 * considered invalid to build a cpu_logical_map 278 * considered invalid to build a cpu_logical_map
278 * entry. 279 * entry.
279 */ 280 */
280 if (of_property_read_u64(dn, "reg", &hwid)) { 281 cell = of_get_property(dn, "reg", NULL);
282 if (!cell) {
281 pr_err("%s: missing reg property\n", dn->full_name); 283 pr_err("%s: missing reg property\n", dn->full_name);
282 goto next; 284 goto next;
283 } 285 }
286 hwid = of_read_number(cell, of_n_addr_cells(dn));
284 287
285 /* 288 /*
286 * Non affinity bits must be set to 0 in the DT 289 * Non affinity bits must be set to 0 in the DT