All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org,
	alex williamson <alex.williamson@redhat.com>,
	borntraeger@de.ibm.com, felipe@nutanix.com
Subject: Re: [Qemu-devel] [PATCH 3/3] virtio: set ISR on dataplane notifications
Date: Wed, 16 Nov 2016 23:20:25 +0200	[thread overview]
Message-ID: <20161116232008-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <1250949559.13223324.1479330331523.JavaMail.zimbra@redhat.com>

On Wed, Nov 16, 2016 at 04:05:31PM -0500, Paolo Bonzini wrote:
> 
> 
> ----- Original Message -----
> > From: "Michael S. Tsirkin" <mst@redhat.com>
> > To: "Paolo Bonzini" <pbonzini@redhat.com>
> > Cc: qemu-devel@nongnu.org, "alex williamson" <alex.williamson@redhat.com>, borntraeger@de.ibm.com, felipe@nutanix.com
> > Sent: Wednesday, November 16, 2016 9:39:24 PM
> > Subject: Re: [PATCH 3/3] virtio: set ISR on dataplane notifications
> > 
> > On Wed, Nov 16, 2016 at 03:38:11PM -0500, Paolo Bonzini wrote:
> > > > > +void virtio_notify_irqfd(VirtIODevice *vdev, VirtQueue *vq)
> > > > > +{
> > > > > +    if (!virtio_should_notify(vdev, vq)) {
> > > > > +        return;
> > > > > +    }
> > > > > +
> > > > > +    trace_virtio_notify_irqfd(vdev, vq);
> > > > > +    virtio_set_isr(vq->vdev, 0x1);
> > > > 
> > > > So here, I think we need a comment with parts of
> > > > the commit log.
> > > > 
> > > > /*
> > > >  * virtio spec 1.0 says ISR bit 0 should be ignored with MSI, but
> > > >  * windows drivers included in virtio-win 1.8.0 (circa 2015)
> > > >  * for Windows 8.1 only are incorrectly polling this bit during shutdown
> > >          ^^^^^^^^^^^^^^^^
> > > 
> > > Not sure it's only for Windows 8.1, in fact probably not.
> > 
> > 8.1 on shutdown and others on crashdump or hibernation?
> 
> Even 8.1 is really a hibernation hidden behind a "Shut down" menu item.
> 
> Paolo

what does "hang during shutdown" in your commit log refer to then?

> > > Looks good if you replace this line with
> > > 
> > > "are incorrectly polling this bit during crashdump or hibernation"
> > > 
> > > Paolo
> > > 
> > > >  * in MSI mode, causing a hang if this bit is never updated.
> > > >  * Next driver release from 2016 fixed this problem, so working around it
> > > >  * is not a must, but it's easy to do so let's do it here.
> > > >  *
> > > >  * Note: it's safe to update ISR from any thread as it was switched
> > > >  * to an atomic operation.
> > > >  */
> > > 
> > > 
> > > > 
> > > > 
> > > > 
> > > > > +    event_notifier_set(&vq->guest_notifier);
> > > > > +}
> > > > > +
> > > > >  void virtio_notify(VirtIODevice *vdev, VirtQueue *vq)
> > > > >  {
> > > > >      if (!virtio_should_notify(vdev, vq)) {
> > > > > @@ -1990,7 +1994,7 @@ static void
> > > > > virtio_queue_guest_notifier_read(EventNotifier *n)
> > > > >  {
> > > > >      VirtQueue *vq = container_of(n, VirtQueue, guest_notifier);
> > > > >      if (event_notifier_test_and_clear(n)) {
> > > > > -        virtio_irq(vq);
> > > > > +        virtio_notify_vector(vq->vdev, vq->vector);
> > > > >      }
> > > > >  }
> > > > >  
> > > > > diff --git a/include/hw/virtio/virtio-scsi.h
> > > > > b/include/hw/virtio/virtio-scsi.h
> > > > > index 9fbc7d7..7375196 100644
> > > > > --- a/include/hw/virtio/virtio-scsi.h
> > > > > +++ b/include/hw/virtio/virtio-scsi.h
> > > > > @@ -137,6 +137,5 @@ void virtio_scsi_push_event(VirtIOSCSI *s,
> > > > > SCSIDevice
> > > > > *dev,
> > > > >  void virtio_scsi_dataplane_setup(VirtIOSCSI *s, Error **errp);
> > > > >  int virtio_scsi_dataplane_start(VirtIODevice *s);
> > > > >  void virtio_scsi_dataplane_stop(VirtIODevice *s);
> > > > > -void virtio_scsi_dataplane_notify(VirtIODevice *vdev, VirtIOSCSIReq
> > > > > *req);
> > > > >  
> > > > >  #endif /* QEMU_VIRTIO_SCSI_H */
> > > > > diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
> > > > > index 835b085..ab0e030 100644
> > > > > --- a/include/hw/virtio/virtio.h
> > > > > +++ b/include/hw/virtio/virtio.h
> > > > > @@ -181,6 +181,7 @@ void virtqueue_get_avail_bytes(VirtQueue *vq,
> > > > > unsigned
> > > > > int *in_bytes,
> > > > >                                 unsigned max_in_bytes, unsigned
> > > > >                                 max_out_bytes);
> > > > >  
> > > > >  bool virtio_should_notify(VirtIODevice *vdev, VirtQueue *vq);
> > > > > +void virtio_notify_irqfd(VirtIODevice *vdev, VirtQueue *vq);
> > > > >  void virtio_notify(VirtIODevice *vdev, VirtQueue *vq);
> > > > >  
> > > > >  void virtio_save(VirtIODevice *vdev, QEMUFile *f);
> > > > > @@ -280,7 +281,6 @@ void virtio_queue_host_notifier_read(EventNotifier
> > > > > *n);
> > > > >  void virtio_queue_aio_set_host_notifier_handler(VirtQueue *vq,
> > > > >  AioContext
> > > > >  *ctx,
> > > > >                                                  void
> > > > >                                                  (*fn)(VirtIODevice *,
> > > > >                                                             VirtQueue
> > > > >                                                             *));
> > > > > -void virtio_irq(VirtQueue *vq);
> > > > >  VirtQueue *virtio_vector_first_queue(VirtIODevice *vdev, uint16_t
> > > > >  vector);
> > > > >  VirtQueue *virtio_vector_next_queue(VirtQueue *vq);
> > > > >  
> > > > > --
> > > > > 2.9.3
> > > > 
> > 

  reply	other threads:[~2016-11-16 21:20 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-16 18:05 [Qemu-devel] [PATCH v2 for-2.8 0/3] virtio fixes Paolo Bonzini
2016-11-16 18:05 ` [Qemu-devel] [PATCH 1/3] virtio: introduce grab/release_ioeventfd to fix vhost Paolo Bonzini
2016-11-17  5:27   ` Alexey Kardashevskiy
2016-11-17  8:36   ` Cornelia Huck
2016-11-18  8:15   ` Christian Borntraeger
2016-11-18 14:23     ` Michael S. Tsirkin
2016-11-16 18:05 ` [Qemu-devel] [PATCH 2/3] virtio: access ISR atomically Paolo Bonzini
2016-11-17 17:55   ` Michael S. Tsirkin
2016-11-17 19:49     ` Paolo Bonzini
2016-11-17 22:33       ` Michael S. Tsirkin
2016-11-18  8:09         ` Paolo Bonzini
2016-11-16 18:05 ` [Qemu-devel] [PATCH 3/3] virtio: set ISR on dataplane notifications Paolo Bonzini
2016-11-16 20:15   ` Michael S. Tsirkin
2016-11-16 20:38     ` Paolo Bonzini
2016-11-16 20:39       ` Michael S. Tsirkin
2016-11-16 21:05         ` Paolo Bonzini
2016-11-16 21:20           ` Michael S. Tsirkin [this message]
2016-11-17  9:04             ` Paolo Bonzini
2016-11-17 16:58               ` Michael S. Tsirkin
2016-11-17 10:44     ` Stefan Hajnoczi
2016-11-16 18:50 ` [Qemu-devel] [PATCH v2 for-2.8 0/3] virtio fixes no-reply
  -- strict thread matches above, loose matches on Subject: below --
2016-11-15 13:46 [Qemu-devel] [PATCH " Paolo Bonzini
2016-11-15 13:46 ` [Qemu-devel] [PATCH 3/3] virtio: set ISR on dataplane notifications Paolo Bonzini
2016-11-15 15:26   ` Michael S. Tsirkin
2016-11-15 15:28     ` Paolo Bonzini
2016-11-15 15:44       ` Michael S. Tsirkin
2016-11-15 16:22         ` Paolo Bonzini
2016-11-15 17:38           ` Michael S. Tsirkin
2016-11-15 17:48             ` Alex Williamson
2016-11-15 17:58               ` Michael S. Tsirkin
2016-11-15 18:21                 ` Alex Williamson
2016-11-15 19:17                   ` Michael S. Tsirkin
2016-11-15 19:51                     ` Alex Williamson

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=20161116232008-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=felipe@nutanix.com \
    --cc=pbonzini@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.