kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Eugenio Pérez" <eperezma@redhat.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	"virtualization@lists.linux-foundation.org" 
	<virtualization@lists.linux-foundation.org>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Linux Next Mailing List <linux-next@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	kvm list <kvm@vger.kernel.org>, Halil Pasic <pasic@linux.ibm.com>,
	Cornelia Huck <cohuck@redhat.com>
Subject: Re: vhost changes (batched) in linux-next after 12/13 trigger random crashes in KVM guests after reboot
Date: Tue, 11 Feb 2020 10:33:39 +0100	[thread overview]
Message-ID: <5119e785ed98cc446ad96d893bd2c6efa127f8e1.camel@redhat.com> (raw)
In-Reply-To: <43a5dbaa-9129-e220-8483-45c60a82c945@de.ibm.com>

On Mon, 2020-02-10 at 12:01 +0100, Christian Borntraeger wrote:
> 
> On 10.02.20 10:47, Eugenio Perez Martin wrote:
> > Hi Christian.
> > 
> > I'm not able to reproduce the failure with eccb852f1fe6bede630e2e4f1a121a81e34354ab commit. Could you add more data?
> > Your configuration (libvirt or qemu line), and host's dmesg output if any?
> > 
> > Thanks!
> 
> If it was not obvious, this is on s390x, a big endian system.
> 

Hi Christian. Thank you very much for the hints.

Could we add some debug traces? Something like the inline patch should give us some clues.

Thanks!

From a8d65d5f0ae3d305443ee84b4842b7c712a1ac1d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
Date: Tue, 11 Feb 2020 10:29:01 +0100
Subject: [PATCH] Add some traces

---
 drivers/vhost/vhost.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index b5a51b1f2e79..60c048eebe4d 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -2239,8 +2239,8 @@ static int fetch_buf(struct vhost_virtqueue *vq)
 		vq->avail_idx = vhost16_to_cpu(vq, avail_idx);
 
 		if (unlikely((u16)(vq->avail_idx - last_avail_idx) > vq->num)) {
-			vq_err(vq, "Guest moved used index from %u to %u",
-				last_avail_idx, vq->avail_idx);
+			vq_err(vq, "Guest moved vq %p used index from %u to %u",
+				vq, last_avail_idx, vq->avail_idx);
 			return -EFAULT;
 		}
 
@@ -2336,6 +2336,8 @@ static int fetch_descs(struct vhost_virtqueue *vq)
 	while (!ret && vq->ndescs <= vq->batch_descs)
 		ret = fetch_buf(vq);
 
+	pr_debug("[vq=%p][vq->ndescs=%d]", vq, vq->ndescs);
+
 	return vq->ndescs ? 0 : ret;
 }
 
@@ -2416,6 +2418,8 @@ int vhost_get_vq_desc(struct vhost_virtqueue *vq,
 	}
 
 	vq->first_desc = i + 1;
+	pr_debug("[vq=%p][vq->ndescs=%d][vq->first_desc=%d]", vq, vq->ndescs,
+		 vq->first_desc);
 
 	return ret;
 
@@ -2459,6 +2463,7 @@ static int __vhost_add_used_n(struct vhost_virtqueue *vq,
 
 	start = vq->last_used_idx & (vq->num - 1);
 	used = vq->used->ring + start;
+	pr_debug("[vq=%p][start=%d][count=%u]", vq, start, count);
 	if (vhost_put_used(vq, heads, start, count)) {
 		vq_err(vq, "Failed to write used");
 		return -EFAULT;
-- 
2.18.1


  reply	other threads:[~2020-02-11  9:33 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-18 14:43 vhost changes (batched) in linux-next after 12/13 trigger random crashes in KVM guests after reboot Christian Borntraeger
2019-12-18 15:10 ` Michael S. Tsirkin
2019-12-18 15:59   ` Christian Borntraeger
2020-01-06 10:50     ` Michael S. Tsirkin
2020-01-07  8:59       ` Christian Borntraeger
2020-01-07  9:39         ` Michael S. Tsirkin
2020-01-07 11:34           ` Christian Borntraeger
2020-01-07 11:47             ` Michael S. Tsirkin
2020-01-07 11:55             ` Michael S. Tsirkin
2020-01-07 12:16               ` Christian Borntraeger
2020-01-20  6:27                 ` Michael S. Tsirkin
2020-01-22 19:32                   ` Christian Borntraeger
2020-02-06 14:22                     ` eperezma
2020-02-06 15:12                       ` Christian Borntraeger
2020-02-06 22:17                         ` Michael S. Tsirkin
2020-02-07  7:47                           ` Christian Borntraeger
2020-02-07  7:58                             ` Michael S. Tsirkin
2020-02-07  8:13                               ` Christian Borntraeger
2020-02-07  8:53                                 ` Cornelia Huck
2020-02-07 10:07                                   ` Michael S. Tsirkin
     [not found]                                 ` <CAJaqyWfngzP4d01B6+Sqt8FXN6jX7kGegjx8ie4no_1Er3igQA@mail.gmail.com>
2020-02-10 10:09                                   ` Christian Borntraeger
2020-02-10 11:01                                   ` Christian Borntraeger
2020-02-11  9:33                                     ` Eugenio Pérez [this message]
     [not found]                                       ` <ab4fb697-afd3-66c0-a74f-4f64dc1ce65f@de.ibm.com>
2020-02-11 10:07                                         ` Christian Borntraeger
2020-02-11 13:04                                     ` Eugenio Pérez
2020-02-11 13:13                                       ` Christian Borntraeger
2020-02-12 16:34                                         ` Eugenio Pérez
2020-02-13  9:30                                           ` Christian Borntraeger
2020-02-13 10:47                                             ` Eugenio Pérez
2020-02-13 13:09                                               ` Christian Borntraeger
2020-02-13 16:29                                                 ` Eugenio Pérez
2020-02-13 16:32                                                   ` Christian Borntraeger
2020-02-14  7:06                                                     ` Eugenio Pérez
2020-02-14  7:33                                                       ` Christian Borntraeger
2020-02-14  7:40                                                         ` Eugenio Perez Martin
2020-02-14  7:43                                                           ` Christian Borntraeger
2020-02-14  7:47                                                             ` Christian Borntraeger
2020-02-14 12:17                                                               ` Eugenio Pérez
2020-02-14 12:22                                                                 ` Christian Borntraeger
2020-02-14 12:26                                                                   ` Eugenio Pérez
2020-02-14 12:34                                                                     ` Christian Borntraeger
2020-03-27 11:08                                                                       ` Eugenio Pérez
2020-03-27 15:46                                                                         ` Christian Borntraeger
2020-02-11 13:57                                       ` Michael S. Tsirkin
2020-03-27  8:03                                         ` Eugenio Perez Martin
2020-02-06 22:07                       ` Michael S. Tsirkin

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=5119e785ed98cc446ad96d893bd2c6efa127f8e1.camel@redhat.com \
    --to=eperezma@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=pasic@linux.ibm.com \
    --cc=sfr@canb.auug.org.au \
    --cc=virtualization@lists.linux-foundation.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 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).