From: Eugenio Perez Martin <eperezma@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Jonah Palmer <jonah.palmer@oracle.com>,
qemu-devel@nongnu.org, jasowang@redhat.com,
si-wei.liu@oracle.com, boris.ostrovsky@oracle.com,
raphael@enfabrica.net, kwolf@redhat.com, hreitz@redhat.com,
pasic@linux.ibm.com, borntraeger@linux.ibm.com,
farman@linux.ibm.com, thuth@redhat.com,
richard.henderson@linaro.org, david@redhat.com,
iii@linux.ibm.com, cohuck@redhat.com, pbonzini@redhat.com,
fam@euphon.net, stefanha@redhat.com, qemu-block@nongnu.org,
qemu-s390x@nongnu.org, virtio-fs@lists.linux.dev
Subject: Re: [PATCH v1 2/8] virtio-pci: Lock ioeventfd state with VIRTIO_F_NOTIFICATION_DATA
Date: Fri, 8 Mar 2024 18:36:47 +0100 [thread overview]
Message-ID: <CAJaqyWcRDjSXbgxMHbdPy_YO4boQthu_4_9zKYX3S5t-G1ju2g@mail.gmail.com> (raw)
In-Reply-To: <20240308115951-mutt-send-email-mst@kernel.org>
On Fri, Mar 8, 2024 at 6:01 PM Michael S. Tsirkin <mst@redhat.com> wrote:
>
> On Mon, Mar 04, 2024 at 02:46:06PM -0500, Jonah Palmer 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.
> >
> > Reviewed-by: Eugenio Pérez <eperezma@redhat.com>
> > Signed-off-by: Jonah Palmer <jonah.palmer@oracle.com>
>
> I thought hard about this. I propose that for now,
> instead of disabling ioevetfd silently we error out unless
> user disabled it for us.
> WDYT?
>
Yes, error is a better plan than silently disabling it. In the
(unlikely?) case we are able to make notification data work with
eventfd in the future, it makes the change more evident.
>
> > ---
> > 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 d12edc567f..287b8f7720 100644
> > --- a/hw/virtio/virtio-pci.c
> > +++ b/hw/virtio/virtio-pci.c
> > @@ -417,13 +417,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
>
next prev parent reply other threads:[~2024-03-08 17:37 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-04 19:46 [PATCH v1 0/8] virtio,vhost: Add VIRTIO_F_NOTIFICATION_DATA support Jonah Palmer
2024-03-04 19:46 ` [PATCH v1 1/8] virtio/virtio-pci: Handle extra notification data Jonah Palmer
2024-03-05 8:04 ` Eugenio Perez Martin
2024-03-04 19:46 ` [PATCH v1 2/8] virtio-pci: Lock ioeventfd state with VIRTIO_F_NOTIFICATION_DATA Jonah Palmer
2024-03-08 17:00 ` Michael S. Tsirkin
2024-03-08 17:36 ` Eugenio Perez Martin [this message]
2024-03-08 17:45 ` Jonah Palmer
2024-03-08 19:19 ` Michael S. Tsirkin
2024-03-11 14:53 ` Jonah Palmer
2024-03-11 15:47 ` Michael S. Tsirkin
2024-03-12 14:33 ` Jonah Palmer
2024-03-12 14:58 ` Michael S. Tsirkin
2024-03-12 15:06 ` Jonah Palmer
2024-03-04 19:46 ` [PATCH v1 3/8] virtio-mmio: Handle extra notification data Jonah Palmer
2024-03-05 8:05 ` Eugenio Perez Martin
2024-03-04 19:46 ` [PATCH v1 4/8] virtio-mmio: Lock ioeventfd state with VIRTIO_F_NOTIFICATION_DATA Jonah Palmer
2024-03-05 8:05 ` Eugenio Perez Martin
2024-03-04 19:46 ` [PATCH v1 5/8] virtio-ccw: Handle extra notification data Jonah Palmer
2024-03-11 15:55 ` Eric Farman
2024-03-04 19:46 ` [PATCH v1 6/8] virtio-ccw: Lock ioeventfd state with VIRTIO_F_NOTIFICATION_DATA Jonah Palmer
2024-03-04 19:46 ` [PATCH v1 7/8] vhost/vhost-user: Add VIRTIO_F_NOTIFICATION_DATA to vhost feature bits Jonah Palmer
2024-03-04 19:46 ` [PATCH v1 8/8] virtio: Add VIRTIO_F_NOTIFICATION_DATA property definition Jonah Palmer
2024-03-06 5:33 ` [PATCH v1 0/8] virtio, vhost: Add VIRTIO_F_NOTIFICATION_DATA support Jason Wang
2024-03-06 7:07 ` Eugenio Perez Martin
2024-03-06 7:33 ` [PATCH v1 0/8] virtio,vhost: " Michael S. Tsirkin
2024-03-07 11:16 ` [PATCH v1 0/8] virtio, vhost: " Eugenio Perez Martin
2024-03-08 13:28 ` Lei Yang
2024-03-08 13:39 ` Jonah Palmer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAJaqyWcRDjSXbgxMHbdPy_YO4boQthu_4_9zKYX3S5t-G1ju2g@mail.gmail.com \
--to=eperezma@redhat.com \
--cc=boris.ostrovsky@oracle.com \
--cc=borntraeger@linux.ibm.com \
--cc=cohuck@redhat.com \
--cc=david@redhat.com \
--cc=fam@euphon.net \
--cc=farman@linux.ibm.com \
--cc=hreitz@redhat.com \
--cc=iii@linux.ibm.com \
--cc=jasowang@redhat.com \
--cc=jonah.palmer@oracle.com \
--cc=kwolf@redhat.com \
--cc=mst@redhat.com \
--cc=pasic@linux.ibm.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=raphael@enfabrica.net \
--cc=richard.henderson@linaro.org \
--cc=si-wei.liu@oracle.com \
--cc=stefanha@redhat.com \
--cc=thuth@redhat.com \
--cc=virtio-fs@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).