[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v1 3/8] virtio-mmio: Handle extra notification data
From: |
Eugenio Perez Martin |
Subject: |
Re: [PATCH v1 3/8] virtio-mmio: Handle extra notification data |
Date: |
Tue, 5 Mar 2024 09:05:19 +0100 |
On Mon, Mar 4, 2024 at 8:46 PM Jonah Palmer <jonah.palmer@oracle.com> wrote:
>
> Add support to virtio-mmio devices for handling the extra data sent from
> the driver to the device when the VIRTIO_F_NOTIFICATION_DATA transport
> feature has been negotiated.
>
> The extra data that's passed to the virtio-mmio device when this feature
> is enabled varies depending on the device's virtqueue layout.
>
> The data passed to the virtio-mmio device is in the same format as the
> data passed to virtio-pci devices.
>
Acked-by: Eugenio Pérez <eperezma@redhat.com>
> Signed-off-by: Jonah Palmer <jonah.palmer@oracle.com>
> ---
> hw/virtio/virtio-mmio.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/hw/virtio/virtio-mmio.c b/hw/virtio/virtio-mmio.c
> index 22f9fbcf5a..f99d5851a2 100644
> --- a/hw/virtio/virtio-mmio.c
> +++ b/hw/virtio/virtio-mmio.c
> @@ -248,6 +248,7 @@ static void virtio_mmio_write(void *opaque, hwaddr
> offset, uint64_t value,
> {
> VirtIOMMIOProxy *proxy = (VirtIOMMIOProxy *)opaque;
> VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
> + uint16_t vq_idx;
>
> trace_virtio_mmio_write_offset(offset, value);
>
> @@ -407,8 +408,12 @@ static void virtio_mmio_write(void *opaque, hwaddr
> offset, uint64_t value,
> }
> break;
> case VIRTIO_MMIO_QUEUE_NOTIFY:
> - if (value < VIRTIO_QUEUE_MAX) {
> - virtio_queue_notify(vdev, value);
> + vq_idx = value;
> + if (vq_idx < VIRTIO_QUEUE_MAX) {
> + if (virtio_vdev_has_feature(vdev, VIRTIO_F_NOTIFICATION_DATA)) {
> + virtio_queue_set_shadow_avail_data(vdev, value);
> + }
> + virtio_queue_notify(vdev, vq_idx);
> }
> break;
> case VIRTIO_MMIO_INTERRUPT_ACK:
> --
> 2.39.3
>
- Re: [PATCH v1 2/8] virtio-pci: Lock ioeventfd state with VIRTIO_F_NOTIFICATION_DATA, (continued)
[PATCH v1 4/8] virtio-mmio: Lock ioeventfd state with VIRTIO_F_NOTIFICATION_DATA, Jonah Palmer, 2024/03/04
[PATCH v1 8/8] virtio: Add VIRTIO_F_NOTIFICATION_DATA property definition, Jonah Palmer, 2024/03/04
[PATCH v1 5/8] virtio-ccw: Handle extra notification data, Jonah Palmer, 2024/03/04
[PATCH v1 6/8] virtio-ccw: Lock ioeventfd state with VIRTIO_F_NOTIFICATION_DATA, Jonah Palmer, 2024/03/04
[PATCH v1 3/8] virtio-mmio: Handle extra notification data, Jonah Palmer, 2024/03/04
- Re: [PATCH v1 3/8] virtio-mmio: Handle extra notification data,
Eugenio Perez Martin <=
[PATCH v1 7/8] vhost/vhost-user: Add VIRTIO_F_NOTIFICATION_DATA to vhost feature bits, Jonah Palmer, 2024/03/04
Re: [PATCH v1 0/8] virtio, vhost: Add VIRTIO_F_NOTIFICATION_DATA support, Jason Wang, 2024/03/06
- Re: [PATCH v1 0/8] virtio, vhost: Add VIRTIO_F_NOTIFICATION_DATA support, Eugenio Perez Martin, 2024/03/06
- Re: [PATCH v1 0/8] virtio,vhost: Add VIRTIO_F_NOTIFICATION_DATA support, Michael S. Tsirkin, 2024/03/06
- Re: [PATCH v1 0/8] virtio, vhost: Add VIRTIO_F_NOTIFICATION_DATA support, Eugenio Perez Martin, 2024/03/07
- Re: [PATCH v1 0/8] virtio, vhost: Add VIRTIO_F_NOTIFICATION_DATA support, Lei Yang, 2024/03/08
- Re: [PATCH v1 0/8] virtio, vhost: Add VIRTIO_F_NOTIFICATION_DATA support, Jonah Palmer, 2024/03/08