ppc/pnv: Add an LPAR per core machine option
authorNicholas Piggin <npiggin@gmail.com>
Fri, 24 May 2024 05:02:46 +0000 (15:02 +1000)
committerNicholas Piggin <npiggin@gmail.com>
Thu, 25 Jul 2024 23:21:06 +0000 (09:21 +1000)
commit3b5ea01e98a5e26c1adb13d966f334cb58680cf8
tree3ecf5d20f41cd46c853901112de42f31964b84ad
parentc8891955086b2fa795efb7fa0e409e32f25e5447
ppc/pnv: Add an LPAR per core machine option

Recent POWER CPUs can operate in "LPAR per core" or "LPAR per thread"
modes. In per-core mode, some SPRs and IPI doorbells are shared between
threads in a core. In per-thread mode, supervisor and user state is
not shared between threads.

OpenPOWER systems after POWER8 use LPAR per thread mode, and it is
required for KVM. Enterprise systems use LPAR per core mode, as they
partition the machine by core.

Implement a lpar-per-core machine option for powernv machines. This
is fixed true for POWER8 machines, and defaults off for P9 and P10.

With this change, powernv8 SMT now works sufficiently to run Linux,
with a single socket. Multi-threaded KVM guests still have problems,
as does multi-socket Linux boot.

Reviewed-by: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
hw/ppc/pnv.c
hw/ppc/pnv_core.c
include/hw/ppc/pnv.h
include/hw/ppc/pnv_chip.h
include/hw/ppc/pnv_core.h
target/ppc/cpu_init.c