提交 e13d23a4 编写于 作者: L Laurent Dufour 提交者: Michael Ellerman

powerpc: export the CPU node count

At boot time, the FDT is parsed to compute the number of CPUs.
In addition count the number of CPU nodes and export it.

This is useful when building the FDT for a kexeced kernel since we need to
take in account the CPU node added since the boot time during CPU hotplug
operations.
Signed-off-by: NLaurent Dufour <ldufour@linux.ibm.com>
Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20221110180619.15796-2-ldufour@linux.ibm.com
上级 5ddcc03a
...@@ -85,6 +85,7 @@ struct of_drc_info { ...@@ -85,6 +85,7 @@ struct of_drc_info {
extern int of_read_drc_info_cell(struct property **prop, extern int of_read_drc_info_cell(struct property **prop,
const __be32 **curval, struct of_drc_info *data); const __be32 **curval, struct of_drc_info *data);
extern unsigned int boot_cpu_node_count;
/* /*
* There are two methods for telling firmware what our capabilities are. * There are two methods for telling firmware what our capabilities are.
......
...@@ -72,6 +72,7 @@ int __initdata iommu_is_off; ...@@ -72,6 +72,7 @@ int __initdata iommu_is_off;
int __initdata iommu_force_on; int __initdata iommu_force_on;
unsigned long tce_alloc_start, tce_alloc_end; unsigned long tce_alloc_start, tce_alloc_end;
u64 ppc64_rma_size; u64 ppc64_rma_size;
unsigned int boot_cpu_node_count __ro_after_init;
#endif #endif
static phys_addr_t first_memblock_size; static phys_addr_t first_memblock_size;
static int __initdata boot_cpu_count; static int __initdata boot_cpu_count;
...@@ -335,6 +336,8 @@ static int __init early_init_dt_scan_cpus(unsigned long node, ...@@ -335,6 +336,8 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
if (type == NULL || strcmp(type, "cpu") != 0) if (type == NULL || strcmp(type, "cpu") != 0)
return 0; return 0;
boot_cpu_node_count++;
/* Get physical cpuid */ /* Get physical cpuid */
intserv = of_get_flat_dt_prop(node, "ibm,ppc-interrupt-server#s", &len); intserv = of_get_flat_dt_prop(node, "ibm,ppc-interrupt-server#s", &len);
if (!intserv) if (!intserv)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册