All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cindy Lu <lulu@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
	Michael Tsirkin <mst@redhat.com>
Subject: Re: [PATCH v7 07/10] virtio-mmio: add support for configure interrupt
Date: Mon, 7 Jun 2021 14:35:52 +0800	[thread overview]
Message-ID: <CACLfguWEieJBONhRfDrOHspcFNfPg=e41tdZ0J2BCxLqjqpC5Q@mail.gmail.com> (raw)
In-Reply-To: <4d06d28c-8a61-5e2f-f6e3-8061f6bc2001@redhat.com>

On Thu, Jun 3, 2021 at 2:36 PM Jason Wang <jasowang@redhat.com> wrote:
>
>
> 在 2021/6/2 上午11:47, Cindy Lu 写道:
> > Add configure interrupt support for virtio-mmio bus. This
> > interrupt will working while backend is vhost-vdpa
> >
> > Signed-off-by: Cindy Lu <lulu@redhat.com>
> > ---
> >   hw/virtio/virtio-mmio.c | 26 ++++++++++++++++++++++++++
> >   1 file changed, 26 insertions(+)
> >
> > diff --git a/hw/virtio/virtio-mmio.c b/hw/virtio/virtio-mmio.c
> > index 13772d52bb..423267d51c 100644
> > --- a/hw/virtio/virtio-mmio.c
> > +++ b/hw/virtio/virtio-mmio.c
> > @@ -670,7 +670,26 @@ static int virtio_mmio_set_guest_notifier(DeviceState *d, int n, bool assign,
> >
> >       return 0;
> >   }
> > +static int virtio_mmio_set_config_notifier(DeviceState *d, bool assign)
> > +{
> > +    VirtIOMMIOProxy *proxy = VIRTIO_MMIO(d);
> > +    VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
> > +    VirtioDeviceClass *vdc = VIRTIO_DEVICE_GET_CLASS(vdev);
> >
> > +    EventNotifier *notifier = virtio_get_config_notifier(vdev);
> > +    int r = 0;
> > +    if (assign) {
> > +        r = event_notifier_init(notifier, 0);
>
>
> The return value is ignored.
>
will add the check here
>
> > +        virtio_set_notifier_fd_handler(vdev, -1, true, false);
>
>
> You'd better use the macro you introduced in patch 1 here?
>
sorry, Seems I missed this, I will correct this
>
> > +    } else {
> > +        virtio_set_notifier_fd_handler(vdev, -1, false, false);
> > +        event_notifier_cleanup(notifier);
> > +    }
> > +    if (vdc->guest_notifier_mask && vdev->use_guest_notifier_mask) {
> > +        vdc->guest_notifier_mask(vdev, -1, !assign);
> > +    }
> > +    return r;
> > +}
> >   static int virtio_mmio_set_guest_notifiers(DeviceState *d, int nvqs,
> >                                              bool assign)
> >   {
> > @@ -692,8 +711,15 @@ static int virtio_mmio_set_guest_notifiers(DeviceState *d, int nvqs,
> >               goto assign_error;
> >           }
> >       }
> > +    r = virtio_mmio_set_config_notifier(d, assign);
> > +    if (r < 0) {
> > +        goto config_assign_error;
> > +    }
> >
> >       return 0;
> > +config_assign_error:
> > +    assert(assign);
> > +    r = virtio_mmio_set_config_notifier(d, false);
>
>
> This looks wired. We only have a single configure interrupt, so assign
> fails should mean unassigned?
>
> Thanks
>
sure Will correct this
> >
> >   assign_error:
> >       /* We get here on assignment failure. Recover by undoing for VQs 0 .. n. */
>



  reply	other threads:[~2021-06-07  6:37 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-02  3:47 [PATCH v7 00/10] vhost-vdpa: add support for configure interrupt Cindy Lu
2021-06-02  3:47 ` [PATCH v7 01/10] virtio: introduce macro IRTIO_CONFIG_IRQ_IDX 聽 Cindy Lu
2021-06-02  3:47 ` [PATCH v7 02/10] virtio-pci:decouple virtqueue from interrupt setting process Cindy Lu
2021-06-03  5:51   ` Jason Wang
2021-06-02  3:47 ` [PATCH v7 03/10] virtio: decouple virtqueue from set notifier fd handler Cindy Lu
2021-06-03  6:01   ` Jason Wang
2021-06-02  3:47 ` [PATCH v7 04/10] vhost: add new call back function for config interrupt Cindy Lu
2021-06-03  6:04   ` Jason Wang
2021-06-02  3:47 ` [PATCH v7 05/10] vhost-vdpa: add support for config interrupt call back Cindy Lu
2021-06-03  6:06   ` Jason Wang
2021-06-07  6:34     ` Cindy Lu
2021-06-02  3:47 ` [PATCH v7 06/10] vhost:add support for configure interrupt Cindy Lu
2021-06-03  6:28   ` Jason Wang
2021-06-08  3:20     ` Cindy Lu
2021-06-02  3:47 ` [PATCH v7 07/10] virtio-mmio: add " Cindy Lu
2021-06-03  6:35   ` Jason Wang
2021-06-07  6:35     ` Cindy Lu [this message]
2021-06-02  3:47 ` [PATCH v7 08/10] virtio-pci: decouple virtqueue from kvm_virtio_pci_vector_use Cindy Lu
2021-06-03  6:39   ` Jason Wang
2021-06-07  6:36     ` Cindy Lu
2021-06-02  3:47 ` [PATCH v7 09/10] virtio-pci: add support for configure interrupt Cindy Lu
2021-06-03  6:45   ` Jason Wang
2021-06-07  6:44     ` Cindy Lu
2021-06-02  3:47 ` [PATCH v7 10/10] virtio-net: add peer_deleted check in virtio_net_handle_rx Cindy Lu
2021-06-03  6:58   ` Jason Wang
2021-06-07  6:20     ` Cindy Lu

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='CACLfguWEieJBONhRfDrOHspcFNfPg=e41tdZ0J2BCxLqjqpC5Q@mail.gmail.com' \
    --to=lulu@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.