kernel_optimize_test/arch/powerpc
Nicholas Piggin 49eff4ab7d KVM: PPC: Book3S HV: Tolerate treclaim. in fake-suspend mode changing registers
commit 267cdfa21385d78c794768233678756e32b39ead upstream.

POWER9 DD2.2 and 2.3 hardware implements a "fake-suspend" mode where
certain TM instructions executed in HV=0 mode cause softpatch interrupts
so the hypervisor can emulate them and prevent problematic processor
conditions. In this fake-suspend mode, the treclaim. instruction does
not modify registers.

Unfortunately the rfscv instruction executed by the guest do not
generate softpatch interrupts, which can cause the hypervisor to lose
track of the fake-suspend mode, and it can execute this treclaim. while
not in fake-suspend mode. This modifies GPRs and crashes the hypervisor.

It's not trivial to disable scv in the guest with HFSCR now, because
they assume a POWER9 has scv available. So this fix saves and restores
checkpointed registers across the treclaim.

Fixes: 7854f7545b ("KVM: PPC: Book3S: Rework TM save/restore code and make it C-callable")
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210908101718.118522-2-npiggin@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-09-22 12:27:59 +02:00
..
boot powerpc/boot: Fixup device-tree on little endian 2021-07-20 16:05:45 +02:00
configs powerpc/config: Renable MTD_PHYSMAP_OF 2021-09-18 13:40:14 +02:00
crypto
include KVM: PPC: Book3S HV Nested: Reflect guest PMU in-use to L0 when guest SPRs are live 2021-09-18 13:40:15 +02:00
kernel powerpc/smp: Update cpu_core_map on all PowerPc systems 2021-09-18 13:40:15 +02:00
kexec powerpc/kexec_file: Use current CPU info while setting up FDT 2021-05-11 14:47:35 +02:00
kvm KVM: PPC: Book3S HV: Tolerate treclaim. in fake-suspend mode changing registers 2021-09-22 12:27:59 +02:00
lib powerpc/64s: Fix crashes when toggling entry flush barrier 2021-05-19 10:13:10 +02:00
math-emu
mm powerpc/numa: Consider the max NUMA node for migratable LPAR 2021-09-18 13:40:14 +02:00
net bpf: Introduce BPF nospec instruction for mitigating Spectre v4 2021-08-04 12:46:44 +02:00
oprofile
perf powerpc/perf/hv-gpci: Fix counter value parsing 2021-09-18 13:40:06 +02:00
platforms powerpc/pseries: Fix regression while building external modules 2021-08-04 12:46:45 +02:00
purgatory
sysdev powerpc/xive: Fix xmon command "dxi" 2021-05-14 09:50:38 +02:00
tools
xmon powerpc/xmon: Change printk() to pr_cont() 2020-12-30 11:54:16 +01:00
Kbuild
Kconfig powerpc: Fix HAVE_HARDLOCKUP_DETECTOR_ARCH build configuration 2021-05-14 09:50:31 +02:00
Kconfig.debug powerpc: iommu: fix build when neither PCI or IBMVIO is set 2021-05-14 09:50:34 +02:00
Makefile Kbuild fixes for v5.10 (2nd) 2020-12-06 10:31:39 -08:00
Makefile.postlink