Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc: Fix endian issue in setup-common.c

During on LE boot we see:

Partition configured for 1073741824 cpus, operating system maximum is 2048.

Clearly missing a byteswap here.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

authored by

Anton Blanchard and committed by
Benjamin Herrenschmidt
01666c8e 36aa1b18

+2 -2
+2 -2
arch/powerpc/kernel/setup-common.c
··· 479 479 if (machine_is(pseries) && firmware_has_feature(FW_FEATURE_LPAR) && 480 480 (dn = of_find_node_by_path("/rtas"))) { 481 481 int num_addr_cell, num_size_cell, maxcpus; 482 - const unsigned int *ireg; 482 + const __be32 *ireg; 483 483 484 484 num_addr_cell = of_n_addr_cells(dn); 485 485 num_size_cell = of_n_size_cells(dn); ··· 489 489 if (!ireg) 490 490 goto out; 491 491 492 - maxcpus = ireg[num_addr_cell + num_size_cell]; 492 + maxcpus = be32_to_cpup(ireg + num_addr_cell + num_size_cell); 493 493 494 494 /* Double maxcpus for processors which have SMT capability */ 495 495 if (cpu_has_feature(CPU_FTR_SMT))