linux/arch/powerpc
Paul Mackerras a8b48a4dcc KVM: PPC: Book3S HV: Fix trap number return from __kvmppc_vcore_entry
This fixes a bug where the trap number that is returned by
__kvmppc_vcore_entry gets corrupted.  The effect of the corruption
is that IPIs get ignored on POWER9 systems when the IPI is sent via
a doorbell interrupt to a CPU which is executing in a KVM guest.
The effect of the IPI being ignored is often that another CPU locks
up inside smp_call_function_many() (and if that CPU is holding a
spinlock, other CPUs then lock up inside raw_spin_lock()).

The trap number is currently held in register r12 for most of the
assembly-language part of the guest exit path.  In that path, we
call kvmppc_subcore_exit_guest(), which is a C function, without
restoring r12 afterwards.  Depending on the kernel config and the
compiler, it may modify r12 or it may not, so some config/compiler
combinations see the bug and others don't.

To fix this, we arrange for the trap number to be stored on the
stack from the 'guest_bypass:' label until the end of the function,
then the trap number is loaded and returned in r12 as before.

Cc: stable@vger.kernel.org # v4.8+
Fixes: fd7bacbca4 ("KVM: PPC: Book3S HV: Fix TB corruption in guest exit path on HMI interrupt")
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2018-03-14 15:10:50 +11:00
..
boot powerpc updates for 4.16 2018-02-02 10:01:04 -08:00
configs powerpc updates for 4.16 2018-02-02 10:01:04 -08:00
crypto
include powerpc/pseries: Fix duplicate firmware feature for DRC_INFO 2018-02-22 14:32:32 +11:00
kernel powerpc/pseries: Revert support for ibm,drc-info devtree property 2018-02-22 14:32:41 +11:00
kvm KVM: PPC: Book3S HV: Fix trap number return from __kvmppc_vcore_entry 2018-03-14 15:10:50 +11:00
lib
math-emu
mm powerpc/mm/drmem: Fix unexpected flag value in ibm,dynamic-memory-v2 2018-02-23 16:45:51 +11:00
net powerpc/bpf/jit: Fix 32-bit JIT for seccomp_data access 2018-02-22 14:36:08 +11:00
oprofile
perf
platforms Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2018-02-25 16:27:51 -08:00
purgatory
sysdev powerpc/xive: Use hw CPU ids when configuring the CPU queues 2018-02-15 09:54:43 +11:00
tools
xmon
Kconfig Merge branch 'linus' into sched/urgent, to resolve conflicts 2018-02-06 21:12:31 +01:00
Kconfig.debug
Makefile
Makefile.postlink