Skip to content

Commit

Permalink
arm64: smp: honour #address-size when parsing CPU reg property
Browse files Browse the repository at this point in the history
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 4c7aa00 ("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>
  • Loading branch information
Will Deacon authored and Catalin Marinas committed Apr 25, 2013
1 parent a84b086 commit 72aea39
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion arch/arm64/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,17 +270,20 @@ void __init smp_init_cpus(void)
bool bootcpu_valid = false;

while ((dn = of_find_node_by_type(dn, "cpu"))) {
const u32 *cell;
u64 hwid;

/*
* A cpu node with missing "reg" property is
* 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
Expand Down

0 comments on commit 72aea39

Please sign in to comment.