linux/arch/powerpc
Paul Mackerras 3deda5e50c KVM: PPC: Book3S HV: Don't try to signal cpu -1
If the target vcpu for kvmppc_fast_vcpu_kick_hv() is not running on
any CPU, then we will have vcpu->arch.thread_cpu == -1, and as it
happens, kvmppc_fast_vcpu_kick_hv will call kvmppc_ipi_thread with
-1 as the cpu argument.  Although this is not meaningful, in the past,
before commit 1704a81cce ("KVM: PPC: Book3S HV: Use msgsnd for IPIs
to other cores on POWER9", 2016-11-18), it was harmless because CPU
-1 is not in the same core as any real CPU thread.  On a POWER9,
however, we don't do the "same core" check, so we were trying to
do a msgsnd to thread -1, which is invalid.  To avoid this, we add
a check to see that vcpu->arch.thread_cpu is >= 0 before calling
kvmppc_ipi_thread() with it.  Since vcpu->arch.thread_vcpu can change
asynchronously, we use READ_ONCE to ensure that the value we check is
the same value that we use as the argument to kvmppc_ipi_thread().

Fixes: 1704a81cce ("KVM: PPC: Book3S HV: Use msgsnd for IPIs to other cores on POWER9")
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2017-01-27 08:58:34 +11:00
..
boot powerpc updates for 4.10 2016-12-16 09:26:42 -08:00
configs powerpc updates for 4.10 2016-12-16 09:26:42 -08:00
crypto crypto: crc32c-vpmsum - Rename CRYPT_CRC32C_VPMSUM option 2016-11-28 21:23:17 +08:00
include Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
kernel powerpc: Fix build warning on 32-bit PPC 2016-12-25 16:12:20 -08:00
kvm KVM: PPC: Book3S HV: Don't try to signal cpu -1 2017-01-27 08:58:34 +11:00
lib Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
math-emu Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
mm Merge branch 'smp-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-12-25 14:05:56 -08:00
net bpf: xdp: Allow head adjustment in XDP prog 2016-12-08 14:25:13 -05:00
oprofile ktime: Cleanup ktime_set() usage 2016-12-25 17:21:22 +01:00
perf cpu/hotplug: Cleanup state names 2016-12-25 10:47:44 +01:00
platforms Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
purgatory powerpc: Add purgatory for kexec_file_load() implementation. 2016-11-30 23:15:26 +11:00
scripts powerpc/ftrace: Add Kconfig & Make glue for mprofile-kernel 2016-03-07 14:53:56 +11:00
sysdev Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
xmon powerpc/xmon: Add 'dt' command to dump trace buffers 2016-11-25 14:30:27 +11:00
Kconfig powerpc: ima: get the kexec buffer passed by the previous kernel 2016-12-20 09:48:40 -08:00
Kconfig.debug powerpc/mm: Fix page table dump build on non-Book3S 2016-12-01 16:20:18 +11:00
Makefile powerpc: Add purgatory for kexec_file_load() implementation. 2016-11-30 23:15:26 +11:00
relocs_check.sh powerpc/64: whitelist unresolved modversions CRCs 2016-09-22 14:46:31 +02:00