linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] KVM: do not use kvm->online_vcpus to check "has one VCPU been created?"
@ 2016-06-13 13:25 Paolo Bonzini
  2016-06-13 13:25 ` [PATCH 1/3] KVM: introduce kvm->created_vcpus Paolo Bonzini
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Paolo Bonzini @ 2016-06-13 13:25 UTC (permalink / raw)
  To: linux-kernel, kvm; +Cc: Cornelia Huck, Christian Borntraeger

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

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

end of thread, other threads:[~2016-06-16  8:23 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-13 13:25 [PATCH 0/3] KVM: do not use kvm->online_vcpus to check "has one VCPU been created?" Paolo Bonzini
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

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).