From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1E3BC352A3 for ; Tue, 11 Feb 2020 09:33:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 83C3120848 for ; Tue, 11 Feb 2020 09:33:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="PTYBeN9y" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726973AbgBKJdq (ORCPT ); Tue, 11 Feb 2020 04:33:46 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:52746 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727558AbgBKJdq (ORCPT ); Tue, 11 Feb 2020 04:33:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581413625; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OorDu29eE+PEol4sSArzlxHl7pCN4jrwJ8i6pGbkBeI=; b=PTYBeN9ydEoeJ00Evl5w+JqVkX4V/F5r9Af5VOODU1bt8C4g2UrlsxsOYFR7Cizgxs23ig YnHFh7ZaNjN7l3xwKbi1HmEizIGaXyd8tzGjOUud7gVH0mB9dYoR6tmDSv+1qxM7g8KcDQ Wbo1xsrae1DzqfnIV7ckMJFCY4Oabs8= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-402-tJWnp8q0M4SbgGOc3mTGcg-1; Tue, 11 Feb 2020 04:33:43 -0500 X-MC-Unique: tJWnp8q0M4SbgGOc3mTGcg-1 Received: by mail-wr1-f69.google.com with SMTP id c6so6531071wrm.18 for ; Tue, 11 Feb 2020 01:33:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=OorDu29eE+PEol4sSArzlxHl7pCN4jrwJ8i6pGbkBeI=; b=q79FmFK8hwt5L7D2Q6aT814VcyNGbFXjhjCrmW/c8aE4phw2Pz3L6P5OAPYWLn63P8 83DEQrFK2W0zPZ/+baj09hyTKSVydsINKOnv0/dgm7j7uqsmzZrySH+U7mMIVtQkdrFB z7y3fLMbqPeXV3HxV249lo0VOMSPtdvvD/1VTm0B6U1c6zt83+M++Db79TajNOPvCgrL iKcm3GBybuaCvz2rMp/t1ALbEw74NRi1Y7iVPldgwBeexAFgWJuskao6t7xr7RR1McGk KqHs6SG0MDkAPi0CSwxZJ/0nVqTZ1DVKdbGHxA1Q5s/mKXDZh354zQbu+hVLI/+DZ2kH Sj2Q== X-Gm-Message-State: APjAAAVf42vtelpDN57jLnf2ui27SL1vJkJYWnWWbwo0CcJCXkvB3lRg fVjvbzx3pbx6dF8VWkqyG9ceeLacxj3zawYzmYWByMi8RyteVJIJcf1NEu4nCaH7gjsQP0Xv+1E pu6LJW9UNBP0zWHbOPpCFRQ== X-Received: by 2002:a1c:cc11:: with SMTP id h17mr4480295wmb.19.1581413622499; Tue, 11 Feb 2020 01:33:42 -0800 (PST) X-Google-Smtp-Source: APXvYqw7fKqgsGAyA5ikiliDn3jmpl1I5sX0SlqMj+bcLy70PjqPun6qfyugqk9My5h3IwXcNukCPg== X-Received: by 2002:a1c:cc11:: with SMTP id h17mr4480274wmb.19.1581413622269; Tue, 11 Feb 2020 01:33:42 -0800 (PST) Received: from eperezma.remote.csb (121.142.221.87.dynamic.jazztel.es. [87.221.142.121]) by smtp.gmail.com with ESMTPSA id s8sm3070475wmf.45.2020.02.11.01.33.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 01:33:41 -0800 (PST) Message-ID: <5119e785ed98cc446ad96d893bd2c6efa127f8e1.camel@redhat.com> Subject: Re: vhost changes (batched) in linux-next after 12/13 trigger random crashes in KVM guests after reboot From: Eugenio =?ISO-8859-1?Q?P=E9rez?= To: Christian Borntraeger Cc: "Michael S. Tsirkin" , "virtualization@lists.linux-foundation.org" , Stephen Rothwell , Linux Next Mailing List , "linux-kernel@vger.kernel.org" , kvm list , Halil Pasic , Cornelia Huck Date: Tue, 11 Feb 2020 10:33:39 +0100 In-Reply-To: <43a5dbaa-9129-e220-8483-45c60a82c945@de.ibm.com> References: <20200107042401-mutt-send-email-mst@kernel.org> <20200107065434-mutt-send-email-mst@kernel.org> <20200120012724-mutt-send-email-mst@kernel.org> <2a63b15f-8cf5-5868-550c-42e2cfd92c60@de.ibm.com> <1ade56b5-083f-bb6f-d3e0-3ddcf78f4d26@de.ibm.com> <20200206171349-mutt-send-email-mst@kernel.org> <5c860fa1-cef5-b389-4ebf-99a62afa0fe8@de.ibm.com> <20200207025806-mutt-send-email-mst@kernel.org> <97c93d38-ef07-e321-d133-18483d54c0c0@de.ibm.com> <43a5dbaa-9129-e220-8483-45c60a82c945@de.ibm.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-6.el8) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-next-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-next@vger.kernel.org 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?= 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