All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH kvmtool 00/24] Virtio v1 support
@ 2022-06-07 17:02 Jean-Philippe Brucker
  2022-06-07 17:02 ` [PATCH kvmtool 01/24] virtio: Add NEEDS_RESET to the status mask Jean-Philippe Brucker
                   ` (25 more replies)
  0 siblings, 26 replies; 29+ messages in thread
From: Jean-Philippe Brucker @ 2022-06-07 17:02 UTC (permalink / raw)
  To: will
  Cc: andre.przywara, alexandru.elisei, kvm, suzuki.poulose,
	sasha.levin, jean-philippe

Add support for version 1 of the virtio transport to kvmtool. Based on a
RFC by Sasha Levin [1], I've been trying to complete it here and there.
It's long overdue and is quite painful to rebase, so let's get it
merged.

Several reasons why the legacy transport needs to be replaced:

* Only 32 feature bits are supported. Most importantly
  VIRTIO_F_ACCESS_PLATFORM, which forces a Linux guest to use the DMA
  API, cannot be enabled. So we can't support private guests that
  decrypt or share only their DMA memory with the host.

* Legacy virtqueue address is a 32-bit pfn, aligned on 4kB. Since Linux
  guests bypass the DMA API they can't support large GPAs.

* New devices types (iommu, crypto, memory, etc) and new features cannot
  be supported.

* New guests won't implement the legacy transport. Existing guests will
  eventually drop legacy support.

Support for modern transport becomes the default and legacy is enabled
with --virtio-legacy.

I only tested what I could: vsock, scsi and vhost-net are currently
broken and can be fixed later (they have issues with mem regions and
feature mask, among other things). I also haven't tested big-endian.

Find the series at https://jpbrucker.net/git/kvmtool/ virtio/devel

[1] https://lore.kernel.org/all/1447823472-17047-1-git-send-email-sasha.levin@oracle.com/
    The SOB was kept in patch 21

Jean-Philippe Brucker (24):
  virtio: Add NEEDS_RESET to the status mask
  virtio: Remove redundant test
  virtio/vsock: Remove redundant state tracking
  virtio: Factor virtqueue initialization
  virtio: Support modern virtqueue addresses
  virtio: Add config access helpers
  virtio: Fix device-specific config endianness
  virtio/console: Remove unused callback
  virtio: Remove set_guest_features() device op
  Add memcpy_fromiovec_safe
  virtio/net: Offload vnet header endianness conversion to tap
  virtio/net: Prepare for modern virtio
  virtio/net: Implement VIRTIO_F_ANY_LAYOUT feature
  virtio/console: Add VIRTIO_F_ANY_LAYOUT feature
  virtio/blk: Implement VIRTIO_F_ANY_LAYOUT feature
  virtio/pci: Factor MSI route creation
  virtio/pci: Delete MSI routes
  virtio: Extract init_vq() for PCI and MMIO
  virtio/pci: Make doorbell offset dynamic
  virtio: Move PCI transport to pci-legacy
  virtio: Add support for modern virtio-pci
  virtio: Move MMIO transport to mmio-legacy
  virtio: Add support for modern virtio-mmio
  virtio/pci: Initialize all vectors to VIRTIO_MSI_NO_VECTOR

 Makefile                          |   4 +
 arm/include/arm-common/kvm-arch.h |   6 +-
 include/kvm/disk-image.h          |   3 +-
 include/kvm/iovec.h               |   2 +
 include/kvm/kvm-config.h          |   1 +
 include/kvm/kvm.h                 |   6 +
 include/kvm/pci.h                 |  11 +
 include/kvm/virtio-9p.h           |   2 +-
 include/kvm/virtio-mmio.h         |  29 ++-
 include/kvm/virtio-pci-dev.h      |   4 +
 include/kvm/virtio-pci.h          |  48 +++-
 include/kvm/virtio.h              |  52 ++--
 mips/include/kvm/kvm-arch.h       |   2 -
 powerpc/include/kvm/kvm-arch.h    |   2 -
 x86/include/kvm/kvm-arch.h        |   2 -
 builtin-run.c                     |   2 +
 disk/core.c                       |  26 +-
 net/uip/core.c                    |  71 ++++--
 util/iovec.c                      |  31 +++
 virtio/9p.c                       |  27 +--
 virtio/balloon.c                  |  46 ++--
 virtio/blk.c                      | 102 ++++----
 virtio/console.c                  |  33 +--
 virtio/core.c                     |  82 ++++++-
 virtio/mmio-legacy.c              | 150 ++++++++++++
 virtio/mmio-modern.c              | 157 ++++++++++++
 virtio/mmio.c                     | 202 ++--------------
 virtio/net.c                      | 122 +++++-----
 virtio/pci-legacy.c               | 205 ++++++++++++++++
 virtio/pci-modern.c               | 386 ++++++++++++++++++++++++++++++
 virtio/pci.c                      | 361 ++++++----------------------
 virtio/rng.c                      |  15 +-
 virtio/scsi.c                     |  44 ++--
 virtio/vsock.c                    |  39 ++-
 34 files changed, 1490 insertions(+), 785 deletions(-)
 create mode 100644 virtio/mmio-legacy.c
 create mode 100644 virtio/mmio-modern.c
 create mode 100644 virtio/pci-legacy.c
 create mode 100644 virtio/pci-modern.c

-- 
2.36.1


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

end of thread, other threads:[~2022-06-10 16:32 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-07 17:02 [PATCH kvmtool 00/24] Virtio v1 support Jean-Philippe Brucker
2022-06-07 17:02 ` [PATCH kvmtool 01/24] virtio: Add NEEDS_RESET to the status mask Jean-Philippe Brucker
2022-06-07 17:02 ` [PATCH kvmtool 02/24] virtio: Remove redundant test Jean-Philippe Brucker
2022-06-07 17:02 ` [PATCH kvmtool 03/24] virtio/vsock: Remove redundant state tracking Jean-Philippe Brucker
2022-06-07 17:02 ` [PATCH kvmtool 04/24] virtio: Factor virtqueue initialization Jean-Philippe Brucker
2022-06-07 17:02 ` [PATCH kvmtool 05/24] virtio: Support modern virtqueue addresses Jean-Philippe Brucker
2022-06-07 17:02 ` [PATCH kvmtool 06/24] virtio: Add config access helpers Jean-Philippe Brucker
2022-06-07 17:02 ` [PATCH kvmtool 07/24] virtio: Fix device-specific config endianness Jean-Philippe Brucker
2022-06-07 17:02 ` [PATCH kvmtool 08/24] virtio/console: Remove unused callback Jean-Philippe Brucker
2022-06-07 17:02 ` [PATCH kvmtool 09/24] virtio: Remove set_guest_features() device op Jean-Philippe Brucker
2022-06-07 17:02 ` [PATCH kvmtool 10/24] Add memcpy_fromiovec_safe Jean-Philippe Brucker
2022-06-07 17:02 ` [PATCH kvmtool 11/24] virtio/net: Offload vnet header endianness conversion to tap Jean-Philippe Brucker
2022-06-07 17:02 ` [PATCH kvmtool 12/24] virtio/net: Prepare for modern virtio Jean-Philippe Brucker
2022-06-07 17:02 ` [PATCH kvmtool 13/24] virtio/net: Implement VIRTIO_F_ANY_LAYOUT feature Jean-Philippe Brucker
2022-06-07 17:02 ` [PATCH kvmtool 14/24] virtio/console: Add " Jean-Philippe Brucker
2022-06-07 17:02 ` [PATCH kvmtool 15/24] virtio/blk: Implement " Jean-Philippe Brucker
2022-06-07 17:02 ` [PATCH kvmtool 16/24] virtio/pci: Factor MSI route creation Jean-Philippe Brucker
2022-06-07 17:02 ` [PATCH kvmtool 17/24] virtio/pci: Delete MSI routes Jean-Philippe Brucker
2022-06-09 12:40   ` Will Deacon
2022-06-07 17:02 ` [PATCH kvmtool 18/24] virtio: Extract init_vq() for PCI and MMIO Jean-Philippe Brucker
2022-06-07 17:02 ` [PATCH kvmtool 19/24] virtio/pci: Make doorbell offset dynamic Jean-Philippe Brucker
2022-06-07 17:02 ` [PATCH kvmtool 20/24] virtio: Move PCI transport to pci-legacy Jean-Philippe Brucker
2022-06-07 17:02 ` [PATCH kvmtool 21/24] virtio: Add support for modern virtio-pci Jean-Philippe Brucker
2022-06-07 17:02 ` [PATCH kvmtool 22/24] virtio: Move MMIO transport to mmio-legacy Jean-Philippe Brucker
2022-06-07 17:02 ` [PATCH kvmtool 23/24] virtio: Add support for modern virtio-mmio Jean-Philippe Brucker
2022-06-07 17:02 ` [PATCH kvmtool 24/24] virtio/pci: Initialize all vectors to VIRTIO_MSI_NO_VECTOR Jean-Philippe Brucker
2022-06-09 12:39 ` [PATCH kvmtool 00/24] Virtio v1 support Will Deacon
2022-06-10 16:31   ` Jean-Philippe Brucker
2022-06-09 12:50 ` Will Deacon

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.