All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] KVM: rename and extend vcpu->requests API
@ 2017-02-16 16:04 Radim Krčmář
  2017-02-16 16:04 ` [PATCH 1/5] KVM: change API for requests to match bit operations Radim Krčmář
                   ` (4 more replies)
  0 siblings, 5 replies; 31+ messages in thread
From: Radim Krčmář @ 2017-02-16 16:04 UTC (permalink / raw)
  To: linux-kernel, kvm
  Cc: Paolo Bonzini, Andrew Jones, Marc Zyngier, Christian Borntraeger,
	Cornelia Huck, James Hogan, Paul Mackerras, Christoffer Dall

KVM requests are not used with one API, but are a mix of open-coded
setting and kicking, which is what this series aims to normalize.

The main problem is described in comment of patch 1:
There are three main kinds of requests
 1) requests from a VCPU to itself,
 2) requests for a remote VCPU,
 3) and requests for a remote VCPU that also expose some data

and we have just one function for setting requests.

The first type of requests leads to just set_bit.  The other two need to
notify the remote VCPU -- often with kvm_vcpu_kick, but if the VCPU is
known to be halted, it can be just swait_activate().  And the third one
needs a memory barrier before setting the bit and after testing it.

The kvm_make_request function we have now is suboptimal in all of these
three cases -- it starts with a barrier, but then doesn't kick, so we
cannot use it for (1) or (2) due to performance issues and we need to
explicitly kick afterwards in (3).

Putting all these into one function would require runtime overhead as it
is not easy to tell if the request is local or remote, but the need for
a barrier can be decided at compile time.

The result of this series is still a mess as it does not include
kvm_vcpu_kick() into kvm_set_request(), but I hope to get an early
feedback about the idea.

(Series based on current kvm/queue.)

Radim Krčmář (5):
  KVM: change API for requests to match bit operations
  KVM: add KVM request variants without barrier
  KVM: optimize kvm_make_all_cpus_request
  KVM: add __kvm_request_needs_mb
  KVM: add kvm_request_pending

 arch/mips/kvm/emulate.c           |   4 +-
 arch/mips/kvm/trap_emul.c         |   4 +-
 arch/powerpc/kvm/book3s_pr.c      |   4 +-
 arch/powerpc/kvm/book3s_pr_papr.c |   2 +-
 arch/powerpc/kvm/booke.c          |  22 +++---
 arch/powerpc/kvm/powerpc.c        |   8 +--
 arch/s390/kvm/kvm-s390.c          |  26 +++----
 arch/s390/kvm/kvm-s390.h          |   4 +-
 arch/s390/kvm/priv.c              |   4 +-
 arch/x86/kvm/hyperv.c             |  14 ++--
 arch/x86/kvm/i8259.c              |   2 +-
 arch/x86/kvm/lapic.c              |  22 +++---
 arch/x86/kvm/mmu.c                |  14 ++--
 arch/x86/kvm/pmu.c                |   6 +-
 arch/x86/kvm/svm.c                |  12 ++--
 arch/x86/kvm/vmx.c                |  32 ++++-----
 arch/x86/kvm/x86.c                | 144 +++++++++++++++++++-------------------
 include/linux/kvm_host.h          |  96 +++++++++++++++++++++----
 virt/kvm/kvm_main.c               |   9 ++-
 19 files changed, 253 insertions(+), 176 deletions(-)

-- 
2.11.1

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

end of thread, other threads:[~2017-02-24 12:47 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-16 16:04 [PATCH 0/5] KVM: rename and extend vcpu->requests API Radim Krčmář
2017-02-16 16:04 ` [PATCH 1/5] KVM: change API for requests to match bit operations Radim Krčmář
2017-02-17  9:30   ` Cornelia Huck
2017-02-17  9:49     ` Andrew Jones
2017-02-17  9:52       ` Cornelia Huck
2017-02-17 15:01     ` Radim Krčmář
2017-02-16 16:04 ` [PATCH 2/5] KVM: add KVM request variants without barrier Radim Krčmář
2017-02-23 10:57   ` Paolo Bonzini
2017-02-23 15:50     ` Radim Krčmář
2017-02-16 16:04 ` [PATCH 3/5] KVM: optimize kvm_make_all_cpus_request Radim Krčmář
2017-02-16 16:04 ` [PATCH 4/5] KVM: add __kvm_request_needs_mb Radim Krčmář
2017-02-16 19:49   ` David Hildenbrand
2017-02-16 21:31     ` Radim Krčmář
2017-02-17  8:46     ` Christian Borntraeger
2017-02-17 10:13       ` David Hildenbrand
2017-02-17 10:19         ` Christian Borntraeger
2017-02-17 11:28         ` Christian Borntraeger
2017-02-22 15:17         ` Radim Krčmář
2017-02-22 19:23           ` Christian Borntraeger
2017-02-23 15:43             ` Radim Krčmář
2017-02-22 19:57           ` Christian Borntraeger
2017-02-23 10:20             ` David Hildenbrand
2017-02-23 15:39               ` Radim Krčmář
2017-02-24 11:34           ` Christoffer Dall
2017-02-24 12:46             ` Andrew Jones
2017-02-23 11:01   ` Paolo Bonzini
2017-02-23 15:52     ` Radim Krčmář
2017-02-16 16:04 ` [PATCH 5/5] KVM: add kvm_request_pending Radim Krčmář
2017-02-16 19:50   ` David Hildenbrand
2017-02-17  9:51   ` Andrew Jones
2017-02-17 14:59     ` Radim Krčmář

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.