kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoffer Dall <christoffer.dall@linaro.org>
To: kvm@vger.kernel.org
Cc: "Andre Przywara" <andre.przywara@arm.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	"Alexander Graf" <agraf@suse.de>,
	borntraeger@de.ibm.com, paulus@ozlabs.org,
	kvmarm@lists.cs.columbia.edu,
	"Christoffer Dall" <christoffer.dall@linaro.org>
Subject: [PATCH v2 0/2] KVM: Synchronize KVM devices list access and create ops
Date: Tue,  9 Aug 2016 19:12:59 +0200	[thread overview]
Message-ID: <20160809171301.24283-1-christoffer.dall@linaro.org> (raw)

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


             reply	other threads:[~2016-08-09 17:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-09 17:12 Christoffer Dall [this message]
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ář

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160809171301.24283-1-christoffer.dall@linaro.org \
    --to=christoffer.dall@linaro.org \
    --cc=agraf@suse.de \
    --cc=andre.przywara@arm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=paulus@ozlabs.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).