Re: [PATCH V2 vfio 6/9] virtio-pci: Introduce APIs to execute legacy IO admin commands

2023-10-31 Thread Yishai Hadas via Virtualization
On 31/10/2023 10:09, Michael S. Tsirkin wrote: On Sun, Oct 29, 2023 at 05:59:49PM +0200, Yishai Hadas wrote: Introduce APIs to execute legacy IO admin commands. It includes: io_legacy_read/write for both common and the device registers, io_legacy_notify_info. In addition, exposing an API to

Re: [PATCH V2 vfio 5/9] virtio-pci: Initialize the supported admin commands

2023-10-30 Thread Yishai Hadas via Virtualization
On 30/10/2023 17:57, Michael S. Tsirkin wrote: On Mon, Oct 30, 2023 at 05:27:50PM +0200, Yishai Hadas wrote: On 29/10/2023 22:17, Michael S. Tsirkin wrote: On Sun, Oct 29, 2023 at 05:59:48PM +0200, Yishai Hadas wrote: Initialize the supported admin commands upon activating the admin queue.

Re: [PATCH V2 vfio 5/9] virtio-pci: Initialize the supported admin commands

2023-10-30 Thread Yishai Hadas via Virtualization
On 29/10/2023 22:17, Michael S. Tsirkin wrote: On Sun, Oct 29, 2023 at 05:59:48PM +0200, Yishai Hadas wrote: Initialize the supported admin commands upon activating the admin queue. The supported commands are saved as part of the admin queue context, it will be used by the next patches from

Re: [PATCH V1 vfio 9/9] vfio/virtio: Introduce a vfio driver over virtio devices

2023-10-29 Thread Yishai Hadas via Virtualization
On 26/10/2023 20:55, Alex Williamson wrote: On Thu, 26 Oct 2023 15:08:12 +0300 Yishai Hadas wrote: On 25/10/2023 22:13, Alex Williamson wrote: On Wed, 25 Oct 2023 17:35:51 +0300 Yishai Hadas wrote: On 24/10/2023 22:57, Alex Williamson wrote: On Tue, 17 Oct 2023 16:42:17 +0300 Yishai

[PATCH V2 vfio 7/9] vfio/pci: Expose vfio_pci_core_setup_barmap()

2023-10-29 Thread Yishai Hadas via Virtualization
Expose vfio_pci_core_setup_barmap() to be used by drivers. This will let drivers to mmap a BAR and re-use it from both vfio and the driver when it's applicable. This API will be used in the next patches by the vfio/virtio coming driver. Signed-off-by: Yishai Hadas ---

[PATCH V2 vfio 9/9] vfio/virtio: Introduce a vfio driver over virtio devices

2023-10-29 Thread Yishai Hadas via Virtualization
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

[PATCH V2 vfio 6/9] virtio-pci: Introduce APIs to execute legacy IO admin commands

2023-10-29 Thread Yishai Hadas via Virtualization
Introduce APIs to execute legacy IO admin commands. It includes: io_legacy_read/write for both common and the device registers, io_legacy_notify_info. In addition, exposing an API to check whether the legacy IO commands are supported. (i.e. virtio_pci_admin_has_legacy_io()). Those APIs will be

[PATCH V2 vfio 4/9] virtio-pci: Introduce admin commands

2023-10-29 Thread Yishai Hadas via Virtualization
From: Feng Liu Introduces admin commands, as follow: The "list query" command can be used by the driver to query the set of admin commands supported by the virtio device. The "list use" command is used to inform the virtio device which admin commands the driver will use. The "legacy common cfg

[PATCH V2 vfio 8/9] vfio/pci: Expose vfio_pci_iowrite/read##size()

2023-10-29 Thread Yishai Hadas via Virtualization
Expose vfio_pci_iowrite/read##size() to let it be used by drivers. This functionality is needed to enable direct access to some physical BAR of the device with the proper locks/checks in place. The next patches from this series will use this functionality on a data path flow when a direct access

[PATCH V2 vfio 5/9] virtio-pci: Initialize the supported admin commands

2023-10-29 Thread Yishai Hadas via Virtualization
Initialize the supported admin commands upon activating the admin queue. The supported commands are saved as part of the admin queue context, it will be used by the next patches from this series. Note: As we don't want to let upper layers to execute admin commands before that this initialization

[PATCH V2 vfio 3/9] virtio-pci: Introduce admin command sending function

2023-10-29 Thread Yishai Hadas via Virtualization
From: Feng Liu Add support for sending admin command through admin virtqueue interface. Abort any inflight admin commands once device reset completes. To enforce the below statement from the specification [1], the admin queue is activated for the upper layer users only post of setting status to

[PATCH V2 vfio 1/9] virtio: Define feature bit for administration virtqueue

2023-10-29 Thread Yishai Hadas via Virtualization
From: Feng Liu Introduce VIRTIO_F_ADMIN_VQ which is used for administration virtqueue support. Signed-off-by: Feng Liu Reviewed-by: Parav Pandit Reviewed-by: Jiri Pirko Signed-off-by: Yishai Hadas --- include/uapi/linux/virtio_config.h | 8 +++- 1 file changed, 7 insertions(+), 1

[PATCH V2 vfio 2/9] virtio-pci: Introduce admin virtqueue

2023-10-29 Thread Yishai Hadas via Virtualization
From: Feng Liu Introduce support for the admin virtqueue. By negotiating VIRTIO_F_ADMIN_VQ feature, driver detects capability and creates one administration virtqueue. Administration virtqueue implementation in virtio pci generic layer, enables multiple types of upper layer drivers such as vfio,

[PATCH V2 vfio 0/9] Introduce a vfio driver over virtio devices

2023-10-29 Thread Yishai Hadas via Virtualization
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

Re: [PATCH V1 vfio 9/9] vfio/virtio: Introduce a vfio driver over virtio devices

2023-10-26 Thread Yishai Hadas via Virtualization
On 25/10/2023 22:13, Alex Williamson wrote: On Wed, 25 Oct 2023 17:35:51 +0300 Yishai Hadas wrote: On 24/10/2023 22:57, Alex Williamson wrote: On Tue, 17 Oct 2023 16:42:17 +0300 Yishai Hadas wrote: Introduce a vfio driver over virtio devices to support the legacy interface functionality

Re: [PATCH V1 vfio 9/9] vfio/virtio: Introduce a vfio driver over virtio devices

2023-10-25 Thread Yishai Hadas via Virtualization
On 24/10/2023 22:57, Alex Williamson wrote: On Tue, 17 Oct 2023 16:42:17 +0300 Yishai Hadas wrote: Introduce a vfio driver over virtio devices to support the legacy interface functionality for VFs. Background, from the virtio spec [1].

Re: [PATCH V1 vfio 6/9] virtio-pci: Introduce APIs to execute legacy IO admin commands

2023-10-25 Thread Yishai Hadas via Virtualization
On 25/10/2023 16:44, Michael S. Tsirkin wrote: On Wed, Oct 25, 2023 at 04:00:43PM +0300, Yishai Hadas wrote: On 25/10/2023 13:17, Michael S. Tsirkin wrote: On Wed, Oct 25, 2023 at 12:18:32PM +0300, Yishai Hadas wrote: On 25/10/2023 0:01, Michael S. Tsirkin wrote: On Tue, Oct 17, 2023

Re: [PATCH V1 vfio 6/9] virtio-pci: Introduce APIs to execute legacy IO admin commands

2023-10-25 Thread Yishai Hadas via Virtualization
On 25/10/2023 13:17, Michael S. Tsirkin wrote: On Wed, Oct 25, 2023 at 12:18:32PM +0300, Yishai Hadas wrote: On 25/10/2023 0:01, Michael S. Tsirkin wrote: On Tue, Oct 17, 2023 at 04:42:14PM +0300, Yishai Hadas wrote: Introduce APIs to execute legacy IO admin commands.

Re: [PATCH V1 vfio 6/9] virtio-pci: Introduce APIs to execute legacy IO admin commands

2023-10-25 Thread Yishai Hadas via Virtualization
Re sending as previous reply was by mistake not in a text format. On 25/10/2023 0:01, Michael S. Tsirkin wrote: On Tue, Oct 17, 2023 at 04:42:14PM +0300, Yishai Hadas wrote: Introduce APIs to execute legacy IO admin commands. It includes: list_query/use, io_legacy_read/write,

Re: [PATCH V1 vfio 6/9] virtio-pci: Introduce APIs to execute legacy IO admin commands

2023-10-25 Thread Yishai Hadas via Virtualization
On 25/10/2023 0:01, Michael S. Tsirkin wrote: On Tue, Oct 17, 2023 at 04:42:14PM +0300, Yishai Hadas wrote: Introduce APIs to execute legacy IO admin commands. It includes: list_query/use, io_legacy_read/write, io_legacy_notify_info. Those APIs will be used by the next patches from this

Re: [PATCH V1 vfio 0/9] Introduce a vfio driver over virtio devices

2023-10-22 Thread Yishai Hadas via Virtualization
On 17/10/2023 16:42, Yishai Hadas wrote: 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

Re: [PATCH V1 vfio 9/9] vfio/virtio: Introduce a vfio driver over virtio devices

2023-10-18 Thread Yishai Hadas via Virtualization
On 17/10/2023 23:24, Alex Williamson wrote: On Tue, 17 Oct 2023 16:42:17 +0300 Yishai Hadas wrote: +static int virtiovf_pci_probe(struct pci_dev *pdev, + const struct pci_device_id *id) +{ + const struct vfio_device_ops *ops = _acc_vfio_pci_ops; + struct

[PATCH V1 vfio 8/9] vfio/pci: Expose vfio_pci_iowrite/read##size()

2023-10-17 Thread Yishai Hadas via Virtualization
Expose vfio_pci_iowrite/read##size() to let it be used by drivers. This functionality is needed to enable direct access to some physical BAR of the device with the proper locks/checks in place. The next patches from this series will use this functionality on a data path flow when a direct access

[PATCH V1 vfio 9/9] vfio/virtio: Introduce a vfio driver over virtio devices

2023-10-17 Thread Yishai Hadas via Virtualization
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

[PATCH V1 vfio 7/9] vfio/pci: Expose vfio_pci_core_setup_barmap()

2023-10-17 Thread Yishai Hadas via Virtualization
Expose vfio_pci_core_setup_barmap() to be used by drivers. This will let drivers to mmap a BAR and re-use it from both vfio and the driver when it's applicable. This API will be used in the next patches by the vfio/virtio coming driver. Signed-off-by: Yishai Hadas ---

[PATCH V1 vfio 6/9] virtio-pci: Introduce APIs to execute legacy IO admin commands

2023-10-17 Thread Yishai Hadas via Virtualization
Introduce APIs to execute legacy IO admin commands. It includes: list_query/use, io_legacy_read/write, io_legacy_notify_info. Those APIs will be used by the next patches from this series. Signed-off-by: Yishai Hadas --- drivers/virtio/virtio_pci_common.c | 11 ++

[PATCH V1 vfio 5/9] virtio-pci: Introduce admin commands

2023-10-17 Thread Yishai Hadas via Virtualization
From: Feng Liu Introduces admin commands, as follow: The "list query" command can be used by the driver to query the set of admin commands supported by the virtio device. The "list use" command is used to inform the virtio device which admin commands the driver will use. The "legacy common cfg

[PATCH V1 vfio 3/9] virtio-pci: Introduce admin virtqueue

2023-10-17 Thread Yishai Hadas via Virtualization
From: Feng Liu Introduce support for the admin virtqueue. By negotiating VIRTIO_F_ADMIN_VQ feature, driver detects capability and creates one administration virtqueue. Administration virtqueue implementation in virtio pci generic layer, enables multiple types of upper layer drivers such as vfio,

[PATCH V1 vfio 4/9] virtio-pci: Introduce admin command sending function

2023-10-17 Thread Yishai Hadas via Virtualization
From: Feng Liu Add support for sending admin command through admin virtqueue interface. Abort any inflight admin commands once device reset completes. To enforce the below statement from the specification [1], the admin queue is activated for the upper layer users only post of setting status to

[PATCH V1 vfio 1/9] virtio-pci: Fix common config map for modern device

2023-10-17 Thread Yishai Hadas via Virtualization
From: Feng Liu Currently vp_modern_probe() missed out to map config space structure starting from notify_data offset. Due to this when such structure elements are accessed it can result in an error. Fix it by considering the minimum size of what device has offered and what driver will access.

[PATCH V1 vfio 2/9] virtio: Define feature bit for administration virtqueue

2023-10-17 Thread Yishai Hadas via Virtualization
From: Feng Liu Introduce VIRTIO_F_ADMIN_VQ which is used for administration virtqueue support. Signed-off-by: Feng Liu Reviewed-by: Parav Pandit Reviewed-by: Jiri Pirko Signed-off-by: Yishai Hadas --- include/uapi/linux/virtio_config.h | 8 +++- 1 file changed, 7 insertions(+), 1

[PATCH V1 vfio 0/9] Introduce a vfio driver over virtio devices

2023-10-17 Thread Yishai Hadas via Virtualization
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

Re: [PATCH vfio 10/11] vfio/virtio: Expose admin commands over virtio device

2023-10-11 Thread Yishai Hadas via Virtualization
On 11/10/2023 12:03, Michael S. Tsirkin wrote: On Wed, Oct 11, 2023 at 11:58:11AM +0300, Yishai Hadas wrote: On 11/10/2023 11:02, Michael S. Tsirkin wrote: On Wed, Oct 11, 2023 at 10:44:49AM +0300, Yishai Hadas wrote: On 10/10/2023 23:42, Michael S. Tsirkin wrote: On Tue, Oct 10, 2023 at

Re: [PATCH vfio 10/11] vfio/virtio: Expose admin commands over virtio device

2023-10-11 Thread Yishai Hadas via Virtualization
On 11/10/2023 11:02, Michael S. Tsirkin wrote: On Wed, Oct 11, 2023 at 10:44:49AM +0300, Yishai Hadas wrote: On 10/10/2023 23:42, Michael S. Tsirkin wrote: On Tue, Oct 10, 2023 at 07:09:08PM +0300, Yishai Hadas wrote: Assuming that we'll put each command inside virtio as the generic layer, we

Re: [PATCH vfio 10/11] vfio/virtio: Expose admin commands over virtio device

2023-10-11 Thread Yishai Hadas via Virtualization
On 10/10/2023 23:42, Michael S. Tsirkin wrote: On Tue, Oct 10, 2023 at 07:09:08PM +0300, Yishai Hadas wrote: Assuming that we'll put each command inside virtio as the generic layer, we won't be able to call/use this API internally to get the PF as of cyclic dependencies between the modules,

Re: [PATCH vfio 10/11] vfio/virtio: Expose admin commands over virtio device

2023-10-10 Thread Yishai Hadas via Virtualization
On 10/10/2023 18:58, Michael S. Tsirkin wrote: On Tue, Oct 10, 2023 at 06:43:32PM +0300, Yishai Hadas wrote: On 10/10/2023 18:14, Michael S. Tsirkin wrote: On Tue, Oct 10, 2023 at 06:09:44PM +0300, Yishai Hadas wrote: On 10/10/2023 17:54, Michael S. Tsirkin wrote: On Tue, Oct 10, 2023 at

Re: [PATCH vfio 10/11] vfio/virtio: Expose admin commands over virtio device

2023-10-10 Thread Yishai Hadas via Virtualization
On 10/10/2023 18:14, Michael S. Tsirkin wrote: On Tue, Oct 10, 2023 at 06:09:44PM +0300, Yishai Hadas wrote: On 10/10/2023 17:54, Michael S. Tsirkin wrote: On Tue, Oct 10, 2023 at 11:08:49AM -0300, Jason Gunthorpe wrote: On Tue, Oct 10, 2023 at 09:56:00AM -0400, Michael S. Tsirkin wrote:

Re: [PATCH vfio 10/11] vfio/virtio: Expose admin commands over virtio device

2023-10-10 Thread Yishai Hadas via Virtualization
On 10/10/2023 17:54, Michael S. Tsirkin wrote: On Tue, Oct 10, 2023 at 11:08:49AM -0300, Jason Gunthorpe wrote: On Tue, Oct 10, 2023 at 09:56:00AM -0400, Michael S. Tsirkin wrote: However - the Intel GPU VFIO driver is such a bad experiance I don't want to encourage people to make VFIO

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-26 Thread Yishai Hadas via Virtualization
On 21/09/2023 22:58, Alex Williamson wrote: On Thu, 21 Sep 2023 15:40:40 +0300 Yishai Hadas wrote: Introduce a vfio driver over virtio devices to support the legacy interface functionality for VFs. Background, from the virtio spec [1].

Re: [PATCH vfio 10/11] vfio/virtio: Expose admin commands over virtio device

2023-09-26 Thread Yishai Hadas via Virtualization
On 22/09/2023 12:54, Michael S. Tsirkin wrote: On Thu, Sep 21, 2023 at 03:40:39PM +0300, Yishai Hadas wrote: Expose admin commands over the virtio device, to be used by the vfio-virtio driver in the next patches. It includes: list query/use, legacy write/read, read notify_info. Signed-off-by:

Re: [PATCH vfio 10/11] vfio/virtio: Expose admin commands over virtio device

2023-09-26 Thread Yishai Hadas via Virtualization
On 21/09/2023 23:34, Michael S. Tsirkin wrote: On Thu, Sep 21, 2023 at 03:40:39PM +0300, Yishai Hadas wrote: Expose admin commands over the virtio device, to be used by the vfio-virtio driver in the next patches. It includes: list query/use, legacy write/read, read notify_info. Signed-off-by:

Re: [PATCH vfio 08/11] vfio/pci: Expose vfio_pci_core_setup_barmap()

2023-09-26 Thread Yishai Hadas via Virtualization
On 21/09/2023 19:35, Alex Williamson wrote: On Thu, 21 Sep 2023 15:40:37 +0300 Yishai Hadas wrote: Expose vfio_pci_core_setup_barmap() to be used by drivers. This will let drivers to mmap a BAR and re-use it from both vfio and the driver when it's applicable. This API will be used in the

[PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-21 Thread Yishai Hadas via Virtualization
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

[PATCH vfio 10/11] vfio/virtio: Expose admin commands over virtio device

2023-09-21 Thread Yishai Hadas via Virtualization
Expose admin commands over the virtio device, to be used by the vfio-virtio driver in the next patches. It includes: list query/use, legacy write/read, read notify_info. Signed-off-by: Yishai Hadas --- drivers/vfio/pci/virtio/cmd.c | 146 ++

[PATCH vfio 08/11] vfio/pci: Expose vfio_pci_core_setup_barmap()

2023-09-21 Thread Yishai Hadas via Virtualization
Expose vfio_pci_core_setup_barmap() to be used by drivers. This will let drivers to mmap a BAR and re-use it from both vfio and the driver when it's applicable. This API will be used in the next patches by the vfio/virtio coming driver. Signed-off-by: Yishai Hadas ---

[PATCH vfio 07/11] virtio-pci: Introduce admin commands

2023-09-21 Thread Yishai Hadas via Virtualization
From: Feng Liu Introduces admin commands, as follow: The "list query" command can be used by the driver to query the set of admin commands supported by the virtio device. The "list use" command is used to inform the virtio device which admin commands the driver will use. The "legacy common cfg

[PATCH vfio 09/11] vfio/pci: Expose vfio_pci_iowrite/read##size()

2023-09-21 Thread Yishai Hadas via Virtualization
Expose vfio_pci_iowrite/read##size() to let it be used by drivers. This functionality is needed to enable direct access to some physical BAR of the device with the proper locks/checks in place. The next patches from this series will use this functionality on a data path flow when a direct access

[PATCH vfio 06/11] virtio-pci: Introduce API to get PF virtio device from VF PCI device

2023-09-21 Thread Yishai Hadas via Virtualization
From: Feng Liu Introduce API to get PF virtio device from the given VF PCI device so that other modules such as vfio in subsequent patch can use it. Signed-off-by: Feng Liu Reviewed-by: Parav Pandit Reviewed-by: Jiri Pirko Signed-off-by: Yishai Hadas --- drivers/virtio/virtio_pci_common.c

[PATCH vfio 05/11] virtio-pci: Introduce admin command sending function

2023-09-21 Thread Yishai Hadas via Virtualization
From: Feng Liu Add support for sending admin command through admin virtqueue interface, and expose generic API to execute virtio admin command. Reuse the send synchronous command helper function at virtio transport layer. In addition, add new result state of admin command and admin commands

[PATCH vfio 04/11] virtio: Expose the synchronous command helper function

2023-09-21 Thread Yishai Hadas via Virtualization
From: Feng Liu Synchronous command helper function is exposed at virtio layer, so that ctrl virtqueue and admin virtqueues can reuse this helper function to send synchronous commands. Signed-off-by: Feng Liu Reviewed-by: Parav Pandit Reviewed-by: Jiri Pirko Signed-off-by: Yishai Hadas ---

[PATCH vfio 02/11] virtio: Define feature bit for administration virtqueue

2023-09-21 Thread Yishai Hadas via Virtualization
From: Feng Liu Introduce VIRTIO_F_ADMIN_VQ which is used for administration virtqueue support. Signed-off-by: Feng Liu Reviewed-by: Parav Pandit Reviewed-by: Jiri Pirko Signed-off-by: Yishai Hadas --- include/uapi/linux/virtio_config.h | 8 +++- 1 file changed, 7 insertions(+), 1

[PATCH vfio 03/11] virtio-pci: Introduce admin virtqueue

2023-09-21 Thread Yishai Hadas via Virtualization
From: Feng Liu Introduce support for the admin virtqueue. By negotiating VIRTIO_F_ADMIN_VQ feature, driver detects capability and creates one administration virtqueue. Administration virtqueue implementation in virtio pci generic layer, enables multiple types of upper layer drivers such as vfio,

[PATCH vfio 01/11] virtio-pci: Use virtio pci device layer vq info instead of generic one

2023-09-21 Thread Yishai Hadas via Virtualization
From: Feng Liu Currently VQ deletion callback vp_del_vqs() processes generic virtio_device level VQ list instead of VQ information available at PCI layer. To adhere to the layering, use the pci device level VQ information stored in the virtqueues or vqs. This also prepares the code to handle

[PATCH vfio 00/11] Introduce a vfio driver over virtio devices

2023-09-21 Thread Yishai Hadas via Virtualization
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