Re: [PATCH] arm64: kernel: numa: fix ACPI boot cpu numa node mapping

2016-10-17 Thread Laszlo Ersek
On 10/17/16 16:18, Lorenzo Pieralisi wrote:
> Commit 7ba5f605f3a0 ("arm64/numa: remove the limitation that cpu0 must
> bind to node0") removed the numa cpu<->node mapping restriction whereby
> logical cpu 0 always corresponds to numa node 0; removing the
> restriction was correct, in that it does not really exist in practice
> but the commit only updated the early mapping of logical cpu 0 to its
> real numa node for the DT boot path, missing the ACPI one, leading to
> boot failures on ACPI systems with numa enabled owing to missing
> node<->cpu map for logical cpu 0.

Small correction request: please drop the "with numa enabled"
qualification. The bug breaks ACPI boot on numa-disabled systems as well
(i.e., where there's only one node, and there are no NUMA-related ACPI
tables (like SRAT) and objects (like _PXM in the DSDT)).

Many thanks!
Laszlo

> 
> Fix the issue by updating the ACPI boot path with code that carries out
> the early cpu<->node mapping also for the boot cpu (ie cpu 0), mirroring
> what is currently done in the DT boot path.
> 
> Fixes: 7ba5f605f3a0 ("arm64/numa: remove the limitation that cpu0 must bind 
> to node0")
> Signed-off-by: Lorenzo Pieralisi 
> Tested-by: Laszlo Ersek 
> Reported-by: Laszlo Ersek 
> Cc: Will Deacon 
> Cc: Laszlo Ersek 
> Cc: Hanjun Guo 
> Cc: Andrew Jones 
> Cc: Zhen Lei 
> Cc: Catalin Marinas 
> ---
>  arch/arm64/kernel/smp.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
> index d3f151c..8507703 100644
> --- a/arch/arm64/kernel/smp.c
> +++ b/arch/arm64/kernel/smp.c
> @@ -544,6 +544,7 @@ acpi_map_gic_cpu_interface(struct 
> acpi_madt_generic_interrupt *processor)
>   return;
>   }
>   bootcpu_valid = true;
> + early_map_cpu_to_node(0, acpi_numa_get_nid(0, hwid));
>   return;
>   }
>  
> 



Re: [PATCH] arm64: kernel: numa: fix ACPI boot cpu numa node mapping

2016-10-17 Thread Laszlo Ersek
On 10/17/16 16:18, Lorenzo Pieralisi wrote:
> Commit 7ba5f605f3a0 ("arm64/numa: remove the limitation that cpu0 must
> bind to node0") removed the numa cpu<->node mapping restriction whereby
> logical cpu 0 always corresponds to numa node 0; removing the
> restriction was correct, in that it does not really exist in practice
> but the commit only updated the early mapping of logical cpu 0 to its
> real numa node for the DT boot path, missing the ACPI one, leading to
> boot failures on ACPI systems with numa enabled owing to missing
> node<->cpu map for logical cpu 0.

Small correction request: please drop the "with numa enabled"
qualification. The bug breaks ACPI boot on numa-disabled systems as well
(i.e., where there's only one node, and there are no NUMA-related ACPI
tables (like SRAT) and objects (like _PXM in the DSDT)).

Many thanks!
Laszlo

> 
> Fix the issue by updating the ACPI boot path with code that carries out
> the early cpu<->node mapping also for the boot cpu (ie cpu 0), mirroring
> what is currently done in the DT boot path.
> 
> Fixes: 7ba5f605f3a0 ("arm64/numa: remove the limitation that cpu0 must bind 
> to node0")
> Signed-off-by: Lorenzo Pieralisi 
> Tested-by: Laszlo Ersek 
> Reported-by: Laszlo Ersek 
> Cc: Will Deacon 
> Cc: Laszlo Ersek 
> Cc: Hanjun Guo 
> Cc: Andrew Jones 
> Cc: Zhen Lei 
> Cc: Catalin Marinas 
> ---
>  arch/arm64/kernel/smp.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
> index d3f151c..8507703 100644
> --- a/arch/arm64/kernel/smp.c
> +++ b/arch/arm64/kernel/smp.c
> @@ -544,6 +544,7 @@ acpi_map_gic_cpu_interface(struct 
> acpi_madt_generic_interrupt *processor)
>   return;
>   }
>   bootcpu_valid = true;
> + early_map_cpu_to_node(0, acpi_numa_get_nid(0, hwid));
>   return;
>   }
>  
> 



[PATCH] arm64: kernel: numa: fix ACPI boot cpu numa node mapping

2016-10-17 Thread Lorenzo Pieralisi
Commit 7ba5f605f3a0 ("arm64/numa: remove the limitation that cpu0 must
bind to node0") removed the numa cpu<->node mapping restriction whereby
logical cpu 0 always corresponds to numa node 0; removing the
restriction was correct, in that it does not really exist in practice
but the commit only updated the early mapping of logical cpu 0 to its
real numa node for the DT boot path, missing the ACPI one, leading to
boot failures on ACPI systems with numa enabled owing to missing
node<->cpu map for logical cpu 0.

Fix the issue by updating the ACPI boot path with code that carries out
the early cpu<->node mapping also for the boot cpu (ie cpu 0), mirroring
what is currently done in the DT boot path.

Fixes: 7ba5f605f3a0 ("arm64/numa: remove the limitation that cpu0 must bind to 
node0")
Signed-off-by: Lorenzo Pieralisi 
Tested-by: Laszlo Ersek 
Reported-by: Laszlo Ersek 
Cc: Will Deacon 
Cc: Laszlo Ersek 
Cc: Hanjun Guo 
Cc: Andrew Jones 
Cc: Zhen Lei 
Cc: Catalin Marinas 
---
 arch/arm64/kernel/smp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
index d3f151c..8507703 100644
--- a/arch/arm64/kernel/smp.c
+++ b/arch/arm64/kernel/smp.c
@@ -544,6 +544,7 @@ acpi_map_gic_cpu_interface(struct 
acpi_madt_generic_interrupt *processor)
return;
}
bootcpu_valid = true;
+   early_map_cpu_to_node(0, acpi_numa_get_nid(0, hwid));
return;
}
 
-- 
2.10.0



[PATCH] arm64: kernel: numa: fix ACPI boot cpu numa node mapping

2016-10-17 Thread Lorenzo Pieralisi
Commit 7ba5f605f3a0 ("arm64/numa: remove the limitation that cpu0 must
bind to node0") removed the numa cpu<->node mapping restriction whereby
logical cpu 0 always corresponds to numa node 0; removing the
restriction was correct, in that it does not really exist in practice
but the commit only updated the early mapping of logical cpu 0 to its
real numa node for the DT boot path, missing the ACPI one, leading to
boot failures on ACPI systems with numa enabled owing to missing
node<->cpu map for logical cpu 0.

Fix the issue by updating the ACPI boot path with code that carries out
the early cpu<->node mapping also for the boot cpu (ie cpu 0), mirroring
what is currently done in the DT boot path.

Fixes: 7ba5f605f3a0 ("arm64/numa: remove the limitation that cpu0 must bind to 
node0")
Signed-off-by: Lorenzo Pieralisi 
Tested-by: Laszlo Ersek 
Reported-by: Laszlo Ersek 
Cc: Will Deacon 
Cc: Laszlo Ersek 
Cc: Hanjun Guo 
Cc: Andrew Jones 
Cc: Zhen Lei 
Cc: Catalin Marinas 
---
 arch/arm64/kernel/smp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
index d3f151c..8507703 100644
--- a/arch/arm64/kernel/smp.c
+++ b/arch/arm64/kernel/smp.c
@@ -544,6 +544,7 @@ acpi_map_gic_cpu_interface(struct 
acpi_madt_generic_interrupt *processor)
return;
}
bootcpu_valid = true;
+   early_map_cpu_to_node(0, acpi_numa_get_nid(0, hwid));
return;
}
 
-- 
2.10.0