All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Galbraith <efault@gmx.de>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>,
	Thorsten Leemhuis <linux@leemhuis.info>,
	virtio-dev@lists.oasis-open.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	rjones@redhat.com
Subject: Re: Random guest crashes since 5c34d002dcc7 ("virtio_pci: use shared interrupts for virtqueues")
Date: Thu, 30 Mar 2017 09:20:35 +0200	[thread overview]
Message-ID: <1490858435.4696.25.camel@gmx.de> (raw)
In-Reply-To: <1490843414.4167.11.camel@gmx.de>

On Thu, 2017-03-30 at 05:10 +0200, Mike Galbraith wrote:

> WRT spin, you should need do nothing more than boot with threadirqs,
> that's 100% repeatable here in absolutely virgin source.

No idea why virtqueue_get_buf() in __send_control_msg() fails forever
with threadirqs, but marking that vq as being busted (it clearly is)
results in one gripe, and a vbox that seemingly cares not one whit that
something went missing.  CONFIG_DEBUG_SHIRQ OTOH notices, mutters
something that sounds like "idiot" when I hibernate the thing ;-)

diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index e9b7e0b3cabe..831406dae1cb 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -567,6 +567,7 @@ static ssize_t __send_control_msg(struct ports_device *portdev, u32 port_id,
 	struct scatterlist sg[1];
 	struct virtqueue *vq;
 	unsigned int len;
+	unsigned long deadline = jiffies+1;
 
 	if (!use_multiport(portdev))
 		return 0;
@@ -583,9 +584,13 @@ static ssize_t __send_control_msg(struct ports_device *portdev, u32 port_id,
 
 	if (virtqueue_add_outbuf(vq, sg, 1, &portdev->cpkt, GFP_ATOMIC) == 0) {
 		virtqueue_kick(vq);
-		while (!virtqueue_get_buf(vq, &len)
-			&& !virtqueue_is_broken(vq))
+		while (!virtqueue_get_buf(vq, &len) && !virtqueue_is_broken(vq)) {
 			cpu_relax();
+			if (time_after(jiffies, deadline)) {
+				trace_printk("Aw crap, I'm stuck.. breaking device\n");
+				virtio_break_device(portdev->vdev);
+			}
+		}
 	}
 
 	spin_unlock(&portdev->c_ovq_lock);

  reply	other threads:[~2017-03-30  7:20 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-23 14:51 Random guest crashes since 5c34d002dcc7 ("virtio_pci: use shared interrupts for virtqueues") Thorsten Leemhuis
2017-03-23 14:56 ` Christoph Hellwig
2017-03-23 14:59   ` Richard W.M. Jones
2017-03-23 15:01   ` Thorsten Leemhuis
2017-03-23 15:19   ` Richard W.M. Jones
2017-03-27  9:07   ` Mike Galbraith
2017-03-27 17:05     ` Christoph Hellwig
2017-03-27 18:16       ` Michael S. Tsirkin
2017-03-28  1:08         ` Mike Galbraith
2017-03-28  2:35           ` Michael S. Tsirkin
2017-03-28  3:16             ` Mike Galbraith
2017-03-28 15:37               ` Michael S. Tsirkin
2017-03-28 16:33                 ` Mike Galbraith
2017-03-28 17:27                   ` Michael S. Tsirkin
2017-03-28 17:47                     ` Mike Galbraith
2017-03-27 18:18       ` Mike Galbraith
2017-03-29  6:23         ` Mike Galbraith
2017-03-29 20:10           ` Michael S. Tsirkin
2017-03-30  3:10             ` Mike Galbraith
2017-03-30  7:20               ` Mike Galbraith [this message]
     [not found]                 ` <20170331041959-mutt-send-email-mst@kernel.org>
2017-03-31  3:22                   ` Michael S. Tsirkin
2017-03-31  8:20                     ` Christoph Hellwig
2017-03-31 16:47                       ` Michael S. Tsirkin
2017-04-03 14:18                         ` Christoph Hellwig
2017-04-03 15:49                           ` Michael S. Tsirkin
2017-04-03 16:14                           ` Michael S. Tsirkin
2017-04-05  6:36                             ` Christoph Hellwig
2017-04-03 17:56                           ` Mike Galbraith
2017-04-03 18:11                             ` Michael S. Tsirkin
2017-04-04  4:02                               ` Mike Galbraith
2017-04-04 13:38                                 ` Michael S. Tsirkin
2017-04-04 14:18                                   ` Mike Galbraith
2017-04-04 14:24                                     ` Michael S. Tsirkin
2017-04-04 15:30                                     ` Michael S. Tsirkin
2017-04-04 17:40                                       ` Mike Galbraith
2017-04-04 17:54                                         ` Mike Galbraith
2017-04-04 18:00                                           ` Michael S. Tsirkin
2017-04-04 18:38                                             ` Mike Galbraith
2017-04-04 21:31                                               ` Michael S. Tsirkin
2017-04-05  2:54                                                 ` Mike Galbraith
2017-04-04 19:03                                           ` Michael S. Tsirkin
2017-04-05  3:09                                             ` Mike Galbraith
2017-04-05  3:13                                               ` Michael S. Tsirkin
2017-04-05  3:24                                                 ` Mike Galbraith
2017-04-05  3:40                                                   ` Mike Galbraith
2017-04-05  3:51                                                     ` Michael S. Tsirkin
2017-04-05  4:24                                                       ` Mike Galbraith
2017-04-05  6:29                                                         ` Christoph Hellwig
2017-04-05  6:51                                                           ` Mike Galbraith
2017-04-05 21:38                                                           ` Michael S. Tsirkin
2017-04-07  6:03                                                             ` Mike Galbraith
2017-04-07  6:24                                                               ` Michael S. Tsirkin
2017-04-07  6:44                                                                 ` Mike Galbraith
2017-04-07  7:05                                                                   ` Mike Galbraith
2017-04-07  7:22                                                                     ` Mike Galbraith
2017-04-07  7:23                                                                       ` Mike Galbraith
2017-04-07 13:20                                                                       ` Michael S. Tsirkin
2017-04-07 13:35                                                                         ` Michael S. Tsirkin
2017-04-07 14:29                                                                           ` Mike Galbraith
2017-04-07 18:56                                                                             ` Michael S. Tsirkin
2017-04-08  5:01                                                                               ` Mike Galbraith
2017-04-10 21:23                                                                                 ` Michael S. Tsirkin
2017-04-11  4:19                                                                                   ` Mike Galbraith
2017-04-05  3:52                                                   ` Michael S. Tsirkin
2017-04-07 21:35                           ` [Random guest crashes since 5c34d002dcc7 ("virtio_pci] 3313bedd74: WARNING:at_include/linux/pci.h:#vp_del_vqs kernel test robot
2017-04-07 21:35                             ` kernel test robot
2017-03-29 20:19           ` Random guest crashes since 5c34d002dcc7 ("virtio_pci: use shared interrupts for virtqueues") Michael S. Tsirkin
2017-03-30  3:54             ` Mike Galbraith
2017-03-28  1:01       ` Mike Galbraith
2017-03-23 14:59 ` Richard W.M. Jones

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=1490858435.4696.25.camel@gmx.de \
    --to=efault@gmx.de \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@leemhuis.info \
    --cc=mst@redhat.com \
    --cc=rjones@redhat.com \
    --cc=virtio-dev@lists.oasis-open.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.