[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC 2/8] virtio-pci: Lock ioeventfd state with VIRTIO_F_NOTIFICATIO
From: |
Eugenio Perez Martin |
Subject: |
Re: [RFC 2/8] virtio-pci: Lock ioeventfd state with VIRTIO_F_NOTIFICATION_DATA |
Date: |
Fri, 1 Mar 2024 20:44:12 +0100 |
On Fri, Mar 1, 2024 at 2:44 PM Jonah Palmer <jonah.palmer@oracle.com> wrote:
>
> Prevent ioeventfd from being enabled/disabled when a virtio-pci
> device has negotiated the VIRTIO_F_NOTIFICATION_DATA transport
> feature.
>
> Due to ioeventfd not being able to carry the extra data associated with
> this feature, the ioeventfd should be left in a disabled state for
> emulated virtio-pci devices using this feature.
>
> Signed-off-by: Jonah Palmer <jonah.palmer@oracle.com>
Reviewed-by: Eugenio Pérez <eperezma@redhat.com>
Thanks!
> ---
> hw/virtio/virtio-pci.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
> index c7c577b177..fd9717a0f5 100644
> --- a/hw/virtio/virtio-pci.c
> +++ b/hw/virtio/virtio-pci.c
> @@ -420,13 +420,15 @@ static void virtio_ioport_write(void *opaque, uint32_t
> addr, uint32_t val)
> }
> break;
> case VIRTIO_PCI_STATUS:
> - if (!(val & VIRTIO_CONFIG_S_DRIVER_OK)) {
> + if (!(val & VIRTIO_CONFIG_S_DRIVER_OK) &&
> + !virtio_vdev_has_feature(vdev, VIRTIO_F_NOTIFICATION_DATA)) {
> virtio_pci_stop_ioeventfd(proxy);
> }
>
> virtio_set_status(vdev, val & 0xFF);
>
> - if (val & VIRTIO_CONFIG_S_DRIVER_OK) {
> + if ((val & VIRTIO_CONFIG_S_DRIVER_OK) &&
> + !virtio_vdev_has_feature(vdev, VIRTIO_F_NOTIFICATION_DATA)) {
> virtio_pci_start_ioeventfd(proxy);
> }
>
> --
> 2.39.3
>
[RFC 4/8] virtio-mmio: Lock ioeventfd state with VIRTIO_F_NOTIFICATION_DATA, Jonah Palmer, 2024/03/01
[RFC 2/8] virtio-pci: Lock ioeventfd state with VIRTIO_F_NOTIFICATION_DATA, Jonah Palmer, 2024/03/01
- Re: [RFC 2/8] virtio-pci: Lock ioeventfd state with VIRTIO_F_NOTIFICATION_DATA,
Eugenio Perez Martin <=
[RFC 3/8] virtio-mmio: Handle extra notification data, Jonah Palmer, 2024/03/01
[RFC 6/8] virtio-ccw: Lock ioeventfd state with VIRTIO_F_NOTIFICATION_DATA, Jonah Palmer, 2024/03/01
[RFC 5/8] virtio-ccw: Handle extra notification data, Jonah Palmer, 2024/03/01
[RFC 7/8] vhost/vhost-user: Add VIRTIO_F_NOTIFICATION_DATA to vhost feature bits, Jonah Palmer, 2024/03/01
[RFC 8/8] virtio: Add VIRTIO_F_NOTIFICATION_DATA property definition, Jonah Palmer, 2024/03/01