linux-stable/arch/powerpc
Michael Ellerman cdeb5d7d89 KVM: PPC: Book3S HV: Make idle_kvm_start_guest() return 0 if it went to guest
We call idle_kvm_start_guest() from power7_offline() if the thread has
been requested to enter KVM. We pass it the SRR1 value that was returned
from power7_idle_insn() which tells us what sort of wakeup we're
processing.

Depending on the SRR1 value we pass in, the KVM code might enter the
guest, or it might return to us to do some host action if the wakeup
requires it.

If idle_kvm_start_guest() is able to handle the wakeup, and enter the
guest it is supposed to indicate that by returning a zero SRR1 value to
us.

That was the behaviour prior to commit 10d91611f4 ("powerpc/64s:
Reimplement book3s idle code in C"), however in that commit the
handling of SRR1 was reworked, and the zeroing behaviour was lost.

Returning from idle_kvm_start_guest() without zeroing the SRR1 value can
confuse the host offline code, causing the guest to crash and other
weirdness.

Fixes: 10d91611f4 ("powerpc/64s: Reimplement book3s idle code in C")
Cc: stable@vger.kernel.org # v5.2+
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20211015133929.832061-2-mpe@ellerman.id.au
2021-10-16 00:40:03 +11:00
..
boot powerpc/boot: Fix build failure since GCC 4.9 removal 2021-09-14 08:33:32 -07:00
configs powerpc/configs/microwatt: Enable options for systemd 2021-08-27 00:56:53 +10:00
crypto crypto: powepc/sha1 - remove unneeded semicolon 2021-03-07 15:13:14 +11:00
include powerpc/32s: Fix kuap_kernel_restore() 2021-10-07 23:34:00 +11:00
kernel powerpc/64s: Fix unrecoverable MCE calling async handler from NMI 2021-10-07 19:54:55 +11:00
kexec powerpc updates for 5.15 2021-09-03 11:22:50 -07:00
kvm KVM: PPC: Book3S HV: Make idle_kvm_start_guest() return 0 if it went to guest 2021-10-16 00:40:03 +11:00
lib powerpc/lib: Add helper to check if offset is within conditional branch range 2021-10-07 18:52:33 +11:00
math-emu powerpc/64s: avoid reloading (H)SRR registers if they are still valid 2021-06-25 00:06:55 +10:00
mm Merge branch 'akpm' (patches from Andrew) 2021-09-08 12:55:35 -07:00
net powerpc/bpf ppc32: Fix BPF_SUB when imm == 0x80000000 2021-10-07 19:52:59 +11:00
perf powerpc/perf: Fix the check for SIAR value 2021-08-25 22:38:19 +10:00
platforms pseries/eeh: Fix the kdump kernel crash during eeh_pseries_init 2021-10-07 23:37:22 +11:00
purgatory powerpc/kexec: Don't use .machine ppc64 in trampoline_64.S 2021-04-08 21:17:43 +10:00
sysdev powerpc/xive: Discard disabled interrupts in get_irqchip_state() 2021-10-13 16:38:55 +11:00
tools powerpc/head_check: Fix shellcheck errors 2021-08-17 22:52:02 +10:00
xmon powerpc: Refactor verification of MSR_RI 2021-08-26 21:21:07 +10:00
Kbuild
Kconfig Tracing updates for 5.15: 2021-09-05 11:50:41 -07:00
Kconfig.debug powerpc/ptdump: Convert powerpc to GENERIC_PTDUMP 2021-08-25 13:35:48 +10:00
Makefile powerpc: Add "-z notext" flag to disable diagnostic 2021-08-15 13:49:39 +10:00
Makefile.postlink