Skip to content

Commit e13d23a

Browse files
ldu4mpe
authored andcommitted
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: Laurent Dufour <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 5ddcc03 commit e13d23a

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

arch/powerpc/include/asm/prom.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ struct of_drc_info {
8585
extern int of_read_drc_info_cell(struct property **prop,
8686
const __be32 **curval, struct of_drc_info *data);
8787

88+
extern unsigned int boot_cpu_node_count;
8889

8990
/*
9091
* There are two methods for telling firmware what our capabilities are.

arch/powerpc/kernel/prom.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ int __initdata iommu_is_off;
7272
int __initdata iommu_force_on;
7373
unsigned long tce_alloc_start, tce_alloc_end;
7474
u64 ppc64_rma_size;
75+
unsigned int boot_cpu_node_count __ro_after_init;
7576
#endif
7677
static phys_addr_t first_memblock_size;
7778
static int __initdata boot_cpu_count;
@@ -335,6 +336,8 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
335336
if (type == NULL || strcmp(type, "cpu") != 0)
336337
return 0;
337338

339+
boot_cpu_node_count++;
340+
338341
/* Get physical cpuid */
339342
intserv = of_get_flat_dt_prop(node, "ibm,ppc-interrupt-server#s", &len);
340343
if (!intserv)

0 commit comments

Comments
 (0)