KVM: Improve MMIO Coalescing API
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest6 patches 6 repliesIn review
- v26 patches 7 repliesSuperseded
- v16 patches 8 repliesSuperseded
Changes in v3 from the cover letter
- Fixed test robot build warning and made small changes suggested by Sean Christopherson
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | KVM: Fix coalesced_mmio_has_room()virt/ | +1 | 1 reply | |
| 2/6 | KVM: Add KVM_CREATE_COALESCED_MMIO_BUFFER ioctlinclude/ include/ virt/ +2 more | +148 | 4 replies | |
| 3/6 | KVM: Support poll() on coalesced mmio buffer fdsvirt/ virt/ | +23 | 0 replies | |
| 4/6 | KVM: Add KVM_(UN)REGISTER_COALESCED_MMIO2 ioctlsinclude/ virt/ virt/ +1 more | +84 | 0 replies | |
| 5/6 | KVM: Documentation: Document v2 of coalesced MMIO APIDocumentation/ | +91 | 0 replies | |
| 6/6 | KVM: selftests: Add coalesced_mmio_testtools/ tools/ | +314 | 1 reply |
Reviews trailers per patch
4 of 6 patches have a Reviewed-by or Acked-by.
| Patch | Paul Durrant |
|---|---|
| 1/6 | R-b |
| 2/6 | R-b |
| 3/6 | |
| 4/6 | R-b |
| 5/6 | R-b |
| 6/6 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v3 0/6] KVM: Improve MMIO Coalescing API
The current MMIO coalescing design has a few drawbacks which limit its usefulness. Currently all coalesced MMIO zones use the same ring buffer. That means that upon a userspace exit we have to handle potentially unrelated MMIO writes synchronously. And a VM-wide lock needs to be taken in the kernel when an MMIO exit occurs.
Additionally, there is no direct way for userspace to be notified about coalesced MMIO writes. If the next MMIO exit to userspace is when the ring buffer has filled then a substantial (and unbounded) amount of time may have passed since the first coalesced MMIO.
This series adds new ioctls to KVM that allow for greater control by making it possible to associate different MMIO zones with different ring buffers. It also allows userspace to use poll() to check for coalesced writes in order to avoid userspace exits in vCPU threads (see patch 3 for why this can be useful).
The idea of improving the API in this way originally came from Paul Durrant ([email protected]) but the implementation is mine.
The first patch in the series is a bug in the existing code that I discovered while writing a selftest and can be merged independently.
Changelog:
v3:
- Fixed test robot build warning and made small changes suggested by Sean Christopherson
v2: https://lore.kernel.org/kvm/[email protected]/T/
v1: https://lore.kernel.org/kvm/[email protected]/T/
Ilias Stamatis (6):
KVM: Fix coalesced_mmio_has_room()
KVM: Add KVM_CREATE_COALESCED_MMIO_BUFFER ioctl
KVM: Support poll() on coalesced mmio buffer fds
KVM: Add KVM_(UN)REGISTER_COALESCED_MMIO2 ioctls
KVM: Documentation: Document v2 of coalesced MMIO API
KVM: selftests: Add coalesced_mmio_test
Documentation/virt/kvm/api.rst | 91 +++++ include/linux/kvm_host.h | 1 + include/uapi/linux/kvm.h | 18 + tools/testing/selftests/kvm/Makefile | 1 + .../selftests/kvm/coalesced_mmio_test.c | 313 ++++++++++++++++++ virt/kvm/coalesced_mmio.c | 203 +++++++++++- virt/kvm/coalesced_mmio.h | 17 +- virt/kvm/kvm_main.c | 37 ++- 8 files changed, 661 insertions(+), 20 deletions(-) create mode 100644 tools/testing/selftests/kvm/coalesced_mmio_test.c
Signature · 1 line
2.34.1