linux/arch/powerpc
Christoffer Dall b68bf84b71 KVM: Protect device ops->create and list_add with kvm->lock
commit a28ebea2ad upstream.

KVM devices were manipulating list data structures without any form of
synchronization, and some implementations of the create operations also
suffered from a lack of synchronization.

Now when we've split the xics create operation into create and init, we
can hold the kvm->lock mutex while calling the create operation and when
manipulating the devices list.

The error path in the generic code gets slightly ugly because we have to
take the mutex again and delete the device from the list, but holding
the mutex during anon_inode_getfd or releasing/locking the mutex in the
common non-error path seemed wrong.

Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
[bwh: Backported to 3.16:
 - Drop change to a failure path that doesn't exist in kvm_vgic_create() 
 - Adjust filename, context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2019-03-25 17:32:35 +00:00
..
boot powerpc: Fix COFF zImage booting on old powermacs 2019-02-11 17:54:13 +00:00
configs powerpc: Remove platforms/wsp and associated pieces 2014-06-11 16:35:38 +10:00
crypto crypto: add missing crypto module aliases 2015-02-04 10:57:50 +00:00
include powerpc/fadump: handle crash memory ranges array index overflow 2018-12-16 22:08:41 +00:00
kernel powerpc/fadump: handle crash memory ranges array index overflow 2018-12-16 22:08:41 +00:00
kvm KVM: Protect device ops->create and list_add with kvm->lock 2019-03-25 17:32:35 +00:00
lib powerpc/lib: Fix the feature fixup tests to actually work 2018-11-20 18:04:53 +00:00
math-emu powerpc: Correct emulated mtfsf instruction 2014-04-07 10:33:11 +10:00
mm powerpc/pseries: Fix unitialized timer reset on migration 2018-12-16 22:09:25 +00:00
net net: filter: make JITs zero A for SKF_AD_ALU_XOR_X 2016-01-25 10:44:05 +00:00
oprofile cpufreq: remove unused notifier: CPUFREQ_{SUSPENDCHANGE|RESUMECHANGE} 2014-03-19 14:10:24 +01:00
perf powerpc/perf: Dereference BHRB entries safely 2018-03-03 15:51:58 +00:00
platforms powerpc/pseries: Fix how we iterate over the DTL entries 2019-02-11 17:53:26 +00:00
sysdev powerpc: Fix size calculation using resource_size() 2018-12-16 22:08:41 +00:00
xmon powerpc/xmon: Fix another endiannes issue in RTAS call from xmon 2015-02-04 10:58:05 +00:00
Kconfig powerpc/bpf/jit: Disable classic BPF JIT on ppc64le 2016-08-22 22:38:18 +01:00
Kconfig.debug powerpc/powernv: Remove OPAL v1 takeover 2014-06-25 13:10:47 +10:00
Makefile powerpc/e500mc: Set assembler machine type to e500mc 2018-11-20 18:05:17 +00:00
relocs_check.pl Fix warning typo "CONFIG_RELCOATABLE" 2013-05-29 15:11:30 +02:00