[PATCH V2] powerpc/pseries/svm: Remove unwanted check for shared_lppaca_size

From: Satheesh Rajendran
Date: Fri Jun 19 2020 - 03:02:08 EST


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, due to the BUG_ON assert
for shared_lppaca_total_size equal to shared_lppaca_size,

[ 0.000000] Partition configured for 64 cpus.
[ 0.000000] CPU maps initialized for 1 thread per core
[ 0.000000] ------------[ cut here ]------------
[ 0.000000] kernel BUG at arch/powerpc/kernel/paca.c:89!
[ 0.000000] Oops: Exception in kernel mode, sig: 5 [#1]
[ 0.000000] LE PAGE_SIZE=64K MMU=Radix SMP NR_CPUS=2048 NUMA pSeries

which is not necessary, let's remove it.

Fixes: bd104e6db6f0 ("powerpc/pseries/svm: Use shared memory for LPPACA structures")
Cc: linux-kernel@xxxxxxxxxxxxxxx
Cc: Michael Ellerman <mpe@xxxxxxxxxxxxxx>
Cc: Thiago Jung Bauermann <bauerman@xxxxxxxxxxxxx>
Cc: Ram Pai <linuxram@xxxxxxxxxx>
Cc: Sukadev Bhattiprolu <sukadev@xxxxxxxxxxxxxxxxxx>
Cc: Laurent Dufour <ldufour@xxxxxxxxxxxxx>
Reviewed-by: Laurent Dufour <ldufour@xxxxxxxxxxxxx>
Reviewed-by: Thiago Jung Bauermann <bauerman@xxxxxxxxxxxxx>
Signed-off-by: Satheesh Rajendran <sathnaga@xxxxxxxxxxxxxxxxxx>
---

V2:
Added Reviewed by Thiago and Laurent.
Added Fixes tag as per Thiago suggest.

V1: https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20200609105731.14032-1-sathnaga@xxxxxxxxxxxxxxxxxx/
---
arch/powerpc/kernel/paca.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/paca.c b/arch/powerpc/kernel/paca.c
index 2168372b792d..74da65aacbc9 100644
--- a/arch/powerpc/kernel/paca.c
+++ b/arch/powerpc/kernel/paca.c
@@ -87,7 +87,7 @@ static void *__init alloc_shared_lppaca(unsigned long size, unsigned long align,
* This is very early in boot, so no harm done if the kernel crashes at
* this point.
*/
- BUG_ON(shared_lppaca_size >= shared_lppaca_total_size);
+ BUG_ON(shared_lppaca_size > shared_lppaca_total_size);

return ptr;
}
--
2.26.2