linux/arch/powerpc/kvm
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
..
book3s_32_mmu_host.c
book3s_32_mmu.c
book3s_32_sr.S
book3s_64_mmu_host.c
book3s_64_mmu_hv.c Second PPC KVM update for 4.16 2018-02-09 22:03:06 +01:00
book3s_64_mmu_radix.c KVM: PPC: Book3S HV: Fix handling of large pages in radix page fault handler 2018-03-02 14:05:32 +11:00
book3s_64_mmu.c KVM: PPC: Book3S PR: Fix WIMG handling under pHyp 2018-01-10 20:45:00 +11:00
book3s_64_slb.S
book3s_64_vio_hv.c
book3s_64_vio.c
book3s_emulate.c
book3s_exports.c
book3s_hv_builtin.c
book3s_hv_hmi.c
book3s_hv_interrupts.S
book3s_hv_ras.c Merge branch 'topic/ppc-kvm' into next 2018-01-21 22:43:43 +11:00
book3s_hv_rm_mmu.c powerpc/mm: Remove unused flag arg in global_invalidates 2018-01-21 20:30:44 +11:00
book3s_hv_rm_xics.c
book3s_hv_rm_xive.c
book3s_hv_rmhandlers.S KVM: PPC: Book3S HV: Fix trap number return from __kvmppc_vcore_entry 2018-03-14 15:10:50 +11:00
book3s_hv.c KVM: PPC: Book3S HV: Fix guest time accounting with VIRT_CPU_ACCOUNTING_GEN 2018-03-03 19:28:34 +11:00
book3s_interrupts.S KVM: PPC: Book3S PR: Fix svcpu copying with preemption enabled 2018-02-01 13:35:33 +11:00
book3s_mmu_hpte.c
book3s_paired_singles.c
book3s_pr_papr.c
book3s_pr.c Second PPC KVM update for 4.16 2018-02-09 22:03:06 +01:00
book3s_rmhandlers.S powerpc/64s: Simple RFI macro conversions 2018-01-10 03:07:30 +11:00
book3s_rtas.c
book3s_segment.S powerpc/64s: Simple RFI macro conversions 2018-01-10 03:07:30 +11:00
book3s_xics.c powerpc: Use octal numbers for file permissions 2018-01-22 05:48:33 +11:00
book3s_xics.h
book3s_xive_template.c
book3s_xive.c treewide/trivial: Remove ';;$' typo noise 2018-02-22 10:59:33 +01:00
book3s_xive.h KVM: PPC: Book3S HV: Enable use of the new XIVE "single escalation" feature 2018-01-19 12:10:21 +11:00
book3s.c KVM: Move vcpu_load to arch-specific kvm_arch_vcpu_ioctl_set_guest_debug 2017-12-14 09:26:56 +01:00
book3s.h
booke_emulate.c
booke_interrupts.S
booke.c KVM: Move vcpu_load to arch-specific kvm_arch_vcpu_ioctl_set_guest_debug 2017-12-14 09:26:56 +01:00
booke.h
bookehv_interrupts.S
e500_emulate.c
e500_mmu_host.c
e500_mmu_host.h
e500_mmu.c
e500.c
e500.h
e500mc.c
emulate_loadstore.c KVM: PPC: Book3S: Add MMIO emulation for VMX instructions 2018-02-09 16:51:51 +11:00
emulate.c
fpu.S
irq.h
Kconfig Second PPC KVM update for 4.16 2018-02-09 22:03:06 +01:00
Makefile
mpic.c
powerpc.c KVM: PPC: Book3S: Fix compile error that occurs with some gcc versions 2018-02-13 15:45:21 +11:00
timing.c KVM: PPC: Use seq_puts() in kvmppc_exit_timing_show() 2018-01-11 20:36:06 +11:00
timing.h
trace_book3s.h
trace_booke.h
trace_hv.h
trace_pr.h
trace.h