Skip to content

Commit a66de52

Browse files
committed
powerpc/pseries: Fix plpks crash on non-pseries
As reported[1] by Nathan, the recently added plpks driver will crash if it's built into the kernel and booted on a non-pseries machine, eg powernv: kernel BUG at arch/powerpc/kernel/syscall.c:39! Oops: Exception in kernel mode, sig: 5 [#1] LE PAGE_SIZE=64K MMU=Radix SMP NR_CPUS=2048 NUMA PowerNV ... NIP system_call_exception+0x90/0x3d0 LR system_call_common+0xec/0x250 Call Trace: 0xc0000000035c3e10 (unreliable) system_call_common+0xec/0x250 --- interrupt: c00 at plpar_hcall+0x38/0x60 NIP: c0000000000e4300 LR: c00000000202945c CTR: 0000000000000000 REGS: c0000000035c3e80 TRAP: 0c00 Not tainted (6.0.0-rc4) MSR: 9000000002009033 <SF,HV,VEC,EE,ME,IR,DR,RI,LE> CR: 28000284 XER: 00000000 ... NIP plpar_hcall+0x38/0x60 LR pseries_plpks_init+0x64/0x23c --- interrupt: c00 On powernv Linux is the hypervisor, so a hypercall just ends up going to the syscall path, which BUGs if the syscall (hypercall) didn't come from userspace. The fix is simply to not probe the plpks driver on non-pseries machines. [1] https://lore.kernel.org/linuxppc-dev/[email protected]/ Fixes: 2454a7a ("powerpc/pseries: define driver for Platform KeyStore") Reported-by: Nathan Chancellor <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Tested-by: Dan Horák <[email protected]> Reviewed-by: Dan Horák <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 6cf0781 commit a66de52

File tree

1 file changed

+2
-1
lines changed
  • arch/powerpc/platforms/pseries

1 file changed

+2
-1
lines changed

arch/powerpc/platforms/pseries/plpks.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <linux/string.h>
1818
#include <linux/types.h>
1919
#include <asm/hvcall.h>
20+
#include <asm/machdep.h>
2021

2122
#include "plpks.h"
2223

@@ -457,4 +458,4 @@ static __init int pseries_plpks_init(void)
457458

458459
return rc;
459460
}
460-
arch_initcall(pseries_plpks_init);
461+
machine_arch_initcall(pseries, pseries_plpks_init);

0 commit comments

Comments
 (0)