linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>,
	Christian Borntraeger <christian.borntraeger@de.ibm.com>
Subject: [PATCH 0/3] KVM: do not use kvm->online_vcpus to check "has one VCPU been created?"
Date: Mon, 13 Jun 2016 15:25:29 +0200	[thread overview]
Message-ID: <1465824332-10628-1-git-send-email-pbonzini@redhat.com> (raw)

kvm->online_vcpus is only updated at the very end of KVM_CREATE_VCPU.
Thus, it can be racy to use it as a check for "has any VCPU been created
already?".  While x86 detects the race through kvm_vcpu_compatible,
it is kinda hackish and s390 does not do anything similar.  Provide a
better fix for both.

Paolo Bonzini (3):
  KVM: introduce created_vcpus
  KVM: remove kvm_vcpu_compatible
  KVM: s390: use created_vcpus

 arch/s390/kvm/kvm-s390.c | 10 +++++-----
 arch/x86/kvm/Kconfig     |  1 -
 arch/x86/kvm/x86.c       | 11 +++--------
 include/linux/kvm_host.h | 14 ++++++++------
 virt/kvm/Kconfig         |  3 ---
 virt/kvm/kvm_main.c      | 27 +++++++++++++++++----------
 6 files changed, 33 insertions(+), 33 deletions(-)

-- 
1.8.3.1

             reply	other threads:[~2016-06-13 13:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-13 13:25 Paolo Bonzini [this message]
2016-06-13 13:25 ` [PATCH 1/3] KVM: introduce kvm->created_vcpus Paolo Bonzini
2016-06-13 14:43   ` Cornelia Huck
2016-06-13 13:25 ` [PATCH 2/3] KVM: remove kvm_vcpu_compatible Paolo Bonzini
2016-06-13 13:25 ` [PATCH 3/3] KVM: s390: use kvm->created_vcpus Paolo Bonzini
2016-06-13 14:36   ` Cornelia Huck
2016-06-13 13:33 ` [PATCH 0/3] KVM: do not use kvm->online_vcpus to check "has one VCPU been created?" Christian Borntraeger
2016-06-13 14:44 ` Cornelia Huck
2016-06-15 22:00   ` Paolo Bonzini
2016-06-16  7:30     ` Christian Borntraeger
2016-06-16  7:59       ` Cornelia Huck
2016-06-16  8:23         ` Paolo Bonzini
2016-06-16  8:07       ` Paolo Bonzini

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=1465824332-10628-1-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=christian.borntraeger@de.ibm.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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).