kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH vfio 00/11] Introduce a vfio driver over virtio devices
@ 2023-09-21 12:40 Yishai Hadas
  2023-09-21 12:40 ` [PATCH vfio 01/11] virtio-pci: Use virtio pci device layer vq info instead of generic one Yishai Hadas
                   ` (10 more replies)
  0 siblings, 11 replies; 181+ messages in thread
From: Yishai Hadas @ 2023-09-21 12:40 UTC (permalink / raw)
  To: alex.williamson, mst, jasowang, jgg
  Cc: kvm, virtualization, parav, feliu, jiri, kevin.tian,
	joao.m.martins, leonro, yishaih, maorg

This series introduce a vfio driver over virtio devices to support the
legacy interface functionality for VFs.

Background, from the virtio spec [1].
--------------------------------------------------------------------
In some systems, there is a need to support a virtio legacy driver with
a device that does not directly support the legacy interface. In such
scenarios, a group owner device can provide the legacy interface
functionality for the group member devices. The driver of the owner
device can then access the legacy interface of a member device on behalf
of the legacy member device driver.

For example, with the SR-IOV group type, group members (VFs) can not
present the legacy interface in an I/O BAR in BAR0 as expected by the
legacy pci driver. If the legacy driver is running inside a virtual
machine, the hypervisor executing the virtual machine can present a
virtual device with an I/O BAR in BAR0. The hypervisor intercepts the
legacy driver accesses to this I/O BAR and forwards them to the group
owner device (PF) using group administration commands.
--------------------------------------------------------------------

The first 7 patches are in the virtio area and handle the below:
- Introduce the admin virtqueue infrastcture.
- Expose APIs to enable upper layers as of vfio, net, etc 
  to execute admin commands.
- Expose the layout of the commands that should be used for
  supporting the legacy access.

The above follows the virtio spec that was lastly accepted in that area
[1].

The last 4 patches are in the vfio area and handle the below:
- Expose some APIs from vfio/pci to be used by the vfio/virtio driver.
- Expose admin commands over virtio device.
- Introduce a vfio driver over virtio devices to support the legacy
  interface functionality for VFs. 

The series was tested successfully over virtio-net VFs in the host,
while running in the guest both modern and legacy drivers.

[1]
https://github.com/oasis-tcs/virtio-spec/commit/03c2d32e5093ca9f2a17797242fbef88efe94b8c

Yishai

Feng Liu (7):
  virtio-pci: Use virtio pci device layer vq info instead of generic one
  virtio: Define feature bit for administration virtqueue
  virtio-pci: Introduce admin virtqueue
  virtio: Expose the synchronous command helper function
  virtio-pci: Introduce admin command sending function
  virtio-pci: Introduce API to get PF virtio device from VF PCI device
  virtio-pci: Introduce admin commands

Yishai Hadas (4):
  vfio/pci: Expose vfio_pci_core_setup_barmap()
  vfio/pci: Expose vfio_pci_iowrite/read##size()
  vfio/virtio: Expose admin commands over virtio device
  vfio/virtio: Introduce a vfio driver over virtio devices

 MAINTAINERS                            |   6 +
 drivers/net/virtio_net.c               |  21 +-
 drivers/vfio/pci/Kconfig               |   2 +
 drivers/vfio/pci/Makefile              |   2 +
 drivers/vfio/pci/vfio_pci_core.c       |  25 ++
 drivers/vfio/pci/vfio_pci_rdwr.c       |  38 +-
 drivers/vfio/pci/virtio/Kconfig        |  15 +
 drivers/vfio/pci/virtio/Makefile       |   4 +
 drivers/vfio/pci/virtio/cmd.c          | 146 +++++++
 drivers/vfio/pci/virtio/cmd.h          |  35 ++
 drivers/vfio/pci/virtio/main.c         | 546 +++++++++++++++++++++++++
 drivers/virtio/Makefile                |   2 +-
 drivers/virtio/virtio.c                |  44 +-
 drivers/virtio/virtio_pci_common.c     |  24 +-
 drivers/virtio/virtio_pci_common.h     |  17 +-
 drivers/virtio/virtio_pci_modern.c     |  12 +-
 drivers/virtio/virtio_pci_modern_avq.c | 138 +++++++
 drivers/virtio/virtio_ring.c           |  27 ++
 include/linux/vfio_pci_core.h          |  20 +
 include/linux/virtio.h                 |  19 +
 include/linux/virtio_config.h          |   7 +
 include/linux/virtio_pci_modern.h      |   3 +
 include/uapi/linux/virtio_config.h     |   8 +-
 include/uapi/linux/virtio_pci.h        |  66 +++
 24 files changed, 1171 insertions(+), 56 deletions(-)
 create mode 100644 drivers/vfio/pci/virtio/Kconfig
 create mode 100644 drivers/vfio/pci/virtio/Makefile
 create mode 100644 drivers/vfio/pci/virtio/cmd.c
 create mode 100644 drivers/vfio/pci/virtio/cmd.h
 create mode 100644 drivers/vfio/pci/virtio/main.c
 create mode 100644 drivers/virtio/virtio_pci_modern_avq.c

-- 
2.27.0


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

end of thread, other threads:[~2023-10-16  9:53 UTC | newest]

Thread overview: 181+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-21 12:40 [PATCH vfio 00/11] Introduce a vfio driver over virtio devices Yishai Hadas
2023-09-21 12:40 ` [PATCH vfio 01/11] virtio-pci: Use virtio pci device layer vq info instead of generic one Yishai Hadas
2023-09-21 13:46   ` Michael S. Tsirkin
2023-09-26 19:13     ` Feng Liu
2023-09-27 18:09       ` Feng Liu
2023-09-27 21:24         ` Michael S. Tsirkin
2023-09-21 12:40 ` [PATCH vfio 02/11] virtio: Define feature bit for administration virtqueue Yishai Hadas
2023-09-21 12:40 ` [PATCH vfio 03/11] virtio-pci: Introduce admin virtqueue Yishai Hadas
2023-09-21 13:57   ` Michael S. Tsirkin
2023-09-26 19:23     ` Feng Liu
2023-09-27 18:12       ` Feng Liu
2023-09-27 21:27         ` Michael S. Tsirkin
2023-10-02 18:07           ` Feng Liu
2023-09-21 12:40 ` [PATCH vfio 04/11] virtio: Expose the synchronous command helper function Yishai Hadas
2023-09-21 12:40 ` [PATCH vfio 05/11] virtio-pci: Introduce admin command sending function Yishai Hadas
2023-09-21 12:40 ` [PATCH vfio 06/11] virtio-pci: Introduce API to get PF virtio device from VF PCI device Yishai Hadas
2023-09-21 12:40 ` [PATCH vfio 07/11] virtio-pci: Introduce admin commands Yishai Hadas
2023-09-24  5:18   ` kernel test robot
2023-09-25  3:18   ` kernel test robot
2023-09-21 12:40 ` [PATCH vfio 08/11] vfio/pci: Expose vfio_pci_core_setup_barmap() Yishai Hadas
2023-09-21 16:35   ` Alex Williamson
2023-09-26  9:45     ` Yishai Hadas
2023-09-21 12:40 ` [PATCH vfio 09/11] vfio/pci: Expose vfio_pci_iowrite/read##size() Yishai Hadas
2023-09-21 12:40 ` [PATCH vfio 10/11] vfio/virtio: Expose admin commands over virtio device Yishai Hadas
2023-09-21 13:08   ` Michael S. Tsirkin
2023-09-21 20:34   ` Michael S. Tsirkin
2023-09-26 10:51     ` Yishai Hadas
2023-09-26 11:25       ` Michael S. Tsirkin
2023-09-22  9:54   ` Michael S. Tsirkin
2023-09-26 11:14     ` Yishai Hadas
2023-09-26 11:41       ` Michael S. Tsirkin
2023-09-27 13:18         ` Jason Gunthorpe
2023-09-27 21:30           ` Michael S. Tsirkin
2023-09-27 23:16             ` Jason Gunthorpe
2023-09-28  5:26               ` Michael S. Tsirkin
2023-10-02  6:28         ` Christoph Hellwig
2023-10-02 15:13           ` Jason Gunthorpe
2023-10-05  8:49             ` Christoph Hellwig
2023-10-05 11:10               ` Jason Gunthorpe
2023-10-06 13:09                 ` Christoph Hellwig
2023-10-10 13:10                   ` Jason Gunthorpe
2023-10-10 13:56                     ` Michael S. Tsirkin
2023-10-10 14:08                       ` Jason Gunthorpe
2023-10-10 14:54                         ` Michael S. Tsirkin
2023-10-10 15:09                           ` Yishai Hadas
2023-10-10 15:14                             ` Michael S. Tsirkin
2023-10-10 15:43                               ` Yishai Hadas
2023-10-10 15:58                                 ` Parav Pandit
2023-10-10 15:58                                 ` Michael S. Tsirkin
2023-10-10 16:09                                   ` Yishai Hadas
2023-10-10 20:42                                     ` Michael S. Tsirkin
2023-10-11  7:44                                       ` Yishai Hadas
2023-10-11  8:02                                         ` Michael S. Tsirkin
2023-10-11  8:58                                           ` Yishai Hadas
2023-10-11  9:03                                             ` Michael S. Tsirkin
2023-10-11 11:25                                               ` Yishai Hadas
2023-10-11  6:12                                 ` Christoph Hellwig
2023-10-10 15:59                               ` Jason Gunthorpe
2023-10-10 16:03                                 ` Michael S. Tsirkin
2023-10-10 16:07                                   ` Jason Gunthorpe
2023-10-10 16:21                                     ` Parav Pandit
2023-10-10 20:38                                       ` Michael S. Tsirkin
2023-10-11  6:13                                 ` Christoph Hellwig
2023-10-11  6:43                                   ` Michael S. Tsirkin
2023-10-11  6:59                                     ` Christoph Hellwig
2023-10-11  8:00                                       ` Parav Pandit
2023-10-11  8:10                                         ` Michael S. Tsirkin
2023-10-11 12:18                                           ` Jason Gunthorpe
2023-10-11 17:03                                             ` Michael S. Tsirkin
2023-10-11 17:20                                               ` Jason Gunthorpe
2023-10-11 17:05                                             ` Michael S. Tsirkin
2023-10-12 10:29                                         ` Zhu, Lingshan
2023-10-12 13:27                                           ` Jason Gunthorpe
     [not found]                                             ` <840d4c6f-4150-4818-a66c-1dbe1474b4c6@intel.com>
2023-10-13 13:50                                               ` Michael S. Tsirkin
2023-10-16  8:33                                                 ` Zhu, Lingshan
2023-10-16  8:52                                                   ` Michael S. Tsirkin
2023-10-16  9:53                                                     ` Zhu, Lingshan
2023-10-11  8:12                                       ` Michael S. Tsirkin
2023-10-12 10:30                                       ` Zhu, Lingshan
2023-10-11  6:26                     ` Christoph Hellwig
2023-10-11 13:57                       ` Jason Gunthorpe
2023-10-11 14:17                         ` Christoph Hellwig
2023-10-11 14:58                           ` Jason Gunthorpe
2023-10-11 16:59                             ` Michael S. Tsirkin
2023-10-11 17:19                               ` Jason Gunthorpe
2023-10-11 20:20                                 ` Michael S. Tsirkin
2023-09-21 12:40 ` [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices Yishai Hadas
2023-09-21 13:16   ` Michael S. Tsirkin
2023-09-21 14:11     ` Jason Gunthorpe
2023-09-21 14:16       ` Michael S. Tsirkin
2023-09-21 16:41         ` Jason Gunthorpe
2023-09-21 16:53           ` Michael S. Tsirkin
2023-09-21 18:39             ` Jason Gunthorpe
2023-09-21 19:13               ` Michael S. Tsirkin
2023-09-21 19:49                 ` Jason Gunthorpe
2023-09-21 20:45                   ` Michael S. Tsirkin
2023-09-21 22:55                     ` Jason Gunthorpe
2023-09-22  3:02                       ` Jason Wang
2023-09-22 11:23                       ` Michael S. Tsirkin
2023-09-22 12:15                         ` Jason Gunthorpe
2023-09-22  3:01                   ` Jason Wang
2023-09-22 12:11                     ` Jason Gunthorpe
2023-09-25  2:34                       ` Jason Wang
2023-09-25 12:26                         ` Jason Gunthorpe
2023-09-25 19:44                           ` Michael S. Tsirkin
2023-09-26  0:40                             ` Jason Gunthorpe
2023-09-26  5:34                               ` Michael S. Tsirkin
2023-09-26  5:42                               ` Michael S. Tsirkin
2023-09-26 13:50                                 ` Jason Gunthorpe
2023-09-27 21:38                                   ` Michael S. Tsirkin
2023-09-27 23:20                                     ` Jason Gunthorpe
2023-09-28  5:31                                       ` Michael S. Tsirkin
2023-09-26  4:37                           ` Jason Wang
2023-09-26  5:33                             ` Parav Pandit
2023-09-21 19:17               ` Michael S. Tsirkin
2023-09-21 19:51                 ` Jason Gunthorpe
2023-09-21 20:55                   ` Michael S. Tsirkin
2023-09-21 23:08                     ` Jason Gunthorpe
2023-09-25  4:44                     ` Zhu, Lingshan
2023-09-22  3:45               ` Zhu, Lingshan
2023-09-21 13:33   ` Michael S. Tsirkin
2023-09-21 16:43   ` Alex Williamson
2023-09-21 16:52     ` Jason Gunthorpe
2023-09-21 17:01       ` Michael S. Tsirkin
2023-09-21 17:07         ` Jason Gunthorpe
2023-09-21 17:21           ` Michael S. Tsirkin
2023-09-21 17:44             ` Jason Gunthorpe
2023-09-21 17:55               ` Michael S. Tsirkin
2023-09-21 18:16                 ` Jason Gunthorpe
2023-09-21 19:34                   ` Michael S. Tsirkin
2023-09-21 19:53                     ` Jason Gunthorpe
2023-09-21 20:16                       ` Michael S. Tsirkin
2023-09-21 22:48                         ` Jason Gunthorpe
2023-09-22  9:47                           ` Michael S. Tsirkin
2023-09-22 12:23                             ` Jason Gunthorpe
2023-09-22 15:45                               ` Michael S. Tsirkin
2023-09-22  3:02                         ` Jason Wang
2023-09-22 12:22                           ` Jason Gunthorpe
2023-09-22 12:25                             ` Parav Pandit
2023-09-22 15:13                               ` Michael S. Tsirkin
2023-09-22 15:15                                 ` Jason Gunthorpe
2023-09-22 15:40                                   ` Michael S. Tsirkin
2023-09-22 16:22                                     ` Jason Gunthorpe
2023-09-25 17:36                                       ` Michael S. Tsirkin
2023-09-25  2:30                               ` Jason Wang
2023-09-25  8:26                                 ` Parav Pandit
2023-09-25 18:36                                   ` Michael S. Tsirkin
2023-09-26  2:34                                     ` Zhu, Lingshan
2023-09-26  3:45                                     ` Parav Pandit
2023-09-26  4:37                                       ` Jason Wang
2023-10-12 10:52                                       ` Michael S. Tsirkin
2023-10-12 11:11                                         ` Parav Pandit
2023-10-12 11:30                                           ` Michael S. Tsirkin
2023-10-12 11:40                                             ` Parav Pandit
2023-09-26  2:32                                   ` Jason Wang
2023-09-26  4:01                                     ` Parav Pandit
2023-09-26  4:37                                       ` Jason Wang
2023-09-26  5:27                                         ` Parav Pandit
2023-09-26 11:49                                     ` Michael S. Tsirkin
2023-10-08  4:28                                       ` Jason Wang
2023-09-22  3:02                       ` Jason Wang
2023-09-22 12:25                         ` Jason Gunthorpe
2023-09-22 15:39                           ` Michael S. Tsirkin
2023-09-22 16:19                             ` Jason Gunthorpe
2023-09-25 18:16                               ` Michael S. Tsirkin
2023-09-25 18:53                                 ` Jason Gunthorpe
2023-09-25 19:52                                   ` Michael S. Tsirkin
2023-09-21 17:09         ` Parav Pandit
2023-09-21 17:24           ` Michael S. Tsirkin
2023-09-21 19:58   ` Alex Williamson
2023-09-21 20:01     ` Jason Gunthorpe
2023-09-21 20:20       ` Michael S. Tsirkin
2023-09-21 20:59         ` Alex Williamson
2023-09-22 12:37     ` Jason Gunthorpe
2023-09-22 12:59       ` Parav Pandit
2023-09-26 15:20     ` Yishai Hadas
2023-09-26 17:00       ` Michael S. Tsirkin
2023-10-02  4:38         ` Parav Pandit
2023-09-22 10:10   ` Michael S. Tsirkin
2023-09-22 15:53   ` Michael S. Tsirkin
2023-10-02 11:23     ` Parav Pandit

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