linux/arch/powerpc/platforms
Michael Ellerman a66de5283e 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/Yxe06fbq18Wv9y3W@dev-arch.thelio-3990X/

Fixes: 2454a7af0f ("powerpc/pseries: define driver for Platform KeyStore")
Reported-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Tested-by: Dan Horák <dan@danny.cz>
Reviewed-by: Dan Horák <dan@danny.cz>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20220907065038.1604504-1-mpe@ellerman.id.au
2022-09-08 10:45:57 +10:00
..
4xx powerpc: Fix all occurences of duplicate words 2022-07-25 12:05:15 +10:00
8xx powerpc/8xx: Use kmalloced data structure instead of global static 2022-05-11 23:06:40 +10:00
40x powerpc: Remove asm/prom.h from all files that don't need it 2022-05-08 22:15:04 +10:00
44x powerpc: Add missing headers 2022-05-08 22:15:40 +10:00
52xx powerpc/52xx: Mark gpt driver as not removable 2022-07-18 23:35:25 +10:00
82xx powerpc: Add missing headers 2022-05-08 22:15:40 +10:00
83xx powerpc/platforms/83xx/suspend: Remove write-only global variable 2022-07-28 16:22:14 +10:00
85xx powerpc/85xx: Fix description of MPC85xx and P1/P2 boards options 2022-07-28 16:22:13 +10:00
86xx powerpc: Add missing headers 2022-05-08 22:15:40 +10:00
512x powerpc: Add missing headers 2022-05-08 22:15:40 +10:00
amigaone powerpc: Add missing headers 2022-05-08 22:15:40 +10:00
book3s powerpc: fix typos in comments 2022-05-05 22:12:44 +10:00
cell powerpc/cell/axon_msi: Fix refcount leak in setup_msi_msg_address 2022-08-01 22:21:18 +10:00
chrp powerpc: Fix all occurences of "the the" 2022-05-22 15:59:43 +10:00
embedded6xx powerpc: Add missing headers 2022-05-08 22:15:40 +10:00
maple powerpc: Add missing headers 2022-05-08 22:15:40 +10:00
microwatt random: remove CONFIG_ARCH_RANDOM 2022-07-18 15:03:37 +02:00
pasemi powerpc: Add missing headers 2022-05-08 22:15:40 +10:00
powermac powerpc/powermac: Remove empty function note_scsi_host() 2022-06-26 10:29:44 +10:00
powernv powerpc updates for 6.0 2022-08-06 16:38:17 -07:00
ps3 powerpc: Remove remaining parts of oprofile 2022-07-27 21:36:05 +10:00
pseries powerpc/pseries: Fix plpks crash on non-pseries 2022-09-08 10:45:57 +10:00
fsl_uli1575.c powerpc: Add missing headers 2022-05-08 22:15:40 +10:00
Kconfig powerpc: Rename PPC_NATIVE to PPC_HASH_MMU_NATIVE 2021-12-02 22:57:22 +11:00
Kconfig.cputype powerpc/64e: Fix build failure with GCC 12 (unrecognized opcode: `wrteei') 2022-07-27 21:36:06 +10:00
Makefile powerpc: Add Microwatt platform 2021-06-21 21:15:26 +10:00