Skip to content

Commit b710d27

Browse files
Satheesh Rajendranmpe
authored andcommitted
powerpc/pseries/svm: Fix incorrect check for shared_lppaca_size
Early secure guest boot hits the below crash while booting with vcpus numbers aligned with page boundary for PAGE size of 64k and LPPACA size of 1k i.e 64, 128 etc. Partition configured for 64 cpus. CPU maps initialized for 1 thread per core ------------[ cut here ]------------ kernel BUG at arch/powerpc/kernel/paca.c:89! Oops: Exception in kernel mode, sig: 5 [#1] LE PAGE_SIZE=64K MMU=Radix SMP NR_CPUS=2048 NUMA pSeries This is due to the BUG_ON() for shared_lppaca_total_size equal to shared_lppaca_size. Instead the code should only BUG_ON() if we have exceeded the total_size, which indicates we've overflowed the array. Fixes: bd104e6 ("powerpc/pseries/svm: Use shared memory for LPPACA structures") Cc: [email protected] # v5.4+ Signed-off-by: Satheesh Rajendran <[email protected]> Reviewed-by: Laurent Dufour <[email protected]> Reviewed-by: Thiago Jung Bauermann <[email protected]> [mpe: Reword change log to clarify we're fixing not removing the check] Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 192b6a7 commit b710d27

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/powerpc/kernel/paca.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ static void *__init alloc_shared_lppaca(unsigned long size, unsigned long align,
8787
* This is very early in boot, so no harm done if the kernel crashes at
8888
* this point.
8989
*/
90-
BUG_ON(shared_lppaca_size >= shared_lppaca_total_size);
90+
BUG_ON(shared_lppaca_size > shared_lppaca_total_size);
9191

9292
return ptr;
9393
}

0 commit comments

Comments
 (0)