kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] KVM: Synchronize KVM devices list access and create ops
@ 2016-08-09 17:12 Christoffer Dall
  2016-08-09 17:13 ` [PATCH v2 1/2] KVM: PPC: Move xics_debugfs_init out of create Christoffer Dall
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Christoffer Dall @ 2016-08-09 17:12 UTC (permalink / raw)
  To: kvm
  Cc: Andre Przywara, Paolo Bonzini, Radim Krčmář,
	Alexander Graf, borntraeger, paulus, kvmarm, Christoffer Dall

Currently accesses the kvm->devices list is not synchronized by any
mechanism which can potentially lead to data corruption.  Further, a
number of the create operations on the individual devices are racy and
would allow creation of multiple devices, opposite to the intention.

Factor out portions of the XICS create operation into a separate init
operation and protect the remaining list accesses and create operations
with the kvm->lock.

Tested on arm/arm64 and compile-tested on powerpc for the xics changes.
Tested-by on other archs would be appreciated.

Christoffer Dall (2):
  KVM: PPC: Move xics_debugfs_init out of create
  KVM: Protect device ops->create and list_add with kvm->lock

 arch/arm/kvm/arm.c             |  6 +++++-
 arch/powerpc/kvm/book3s_xics.c | 12 ++++++++----
 include/linux/kvm_host.h       | 12 ++++++++++++
 virt/kvm/arm/vgic/vgic-init.c  | 17 ++++-------------
 virt/kvm/kvm_main.c            | 16 +++++++++++++++-
 5 files changed, 44 insertions(+), 19 deletions(-)

-- 
2.9.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-08-12 12:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-09 17:12 [PATCH v2 0/2] KVM: Synchronize KVM devices list access and create ops Christoffer Dall
2016-08-09 17:13 ` [PATCH v2 1/2] KVM: PPC: Move xics_debugfs_init out of create Christoffer Dall
2016-08-09 17:13 ` [PATCH v2 2/2] KVM: Protect device ops->create and list_add with kvm->lock Christoffer Dall
2016-08-10 10:28   ` Christian Borntraeger
2016-08-12 12:36 ` [PATCH v2 0/2] KVM: Synchronize KVM devices list access and create ops Radim Krčmář

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).