From: "Michael S. Tsirkin" <mst@redhat.com>
To: Halil Pasic <pasic@linux.vnet.ibm.com>
Cc: "Michael A. Tebolt" <miket@us.ibm.com>,
kvm@vger.kernel.org, Greg Kurz <groug@kaod.org>,
virtualization@lists.linux-foundation.org,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>
Subject: Re: [PATCH] vhost: fix initialization for vq->is_le
Date: Tue, 31 Jan 2017 20:28:46 +0200 [thread overview]
Message-ID: <20170131202817-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <277ab88f-d073-cf29-e79f-f048d0c4f42b@linux.vnet.ibm.com>
On Tue, Jan 31, 2017 at 04:56:13PM +0100, Halil Pasic wrote:
>
>
> On 01/30/2017 08:06 PM, Greg Kurz wrote:
> >> Currently, under certain circumstances vhost_init_is_le does just a part
> >> of the initialization job, and depends on vhost_reset_is_le being called
> >> too. For this reason vhost_vq_init_access used to call vhost_reset_is_le
> >> when vq->private_data is NULL. This is not only counter intuitive, but
> >> also real a problem because it breaks vhost_net. The bug was introduced to
> >> vhost_net with commit 2751c9882b94 ("vhost: cross-endian support for
> >> legacy devices"). The symptom is corruption of the vq's used.idx field
> >> (virtio) after VHOST_NET_SET_BACKEND was issued as a part of the vhost
> >> shutdown on a vq with pending descriptors.
> >>
> >> Let us make sure the outcome of vhost_init_is_le never depend on the state
> >> it is actually supposed to initialize, and fix virtio_net by removing the
> >> reset from vhost_vq_init_access.
> >>
> >> With the above, there is no reason for vhost_reset_is_le to do just half
> >> of the job. Let us make vhost_reset_is_le reinitialize is_le.
> >>
> >> Signed-off-by: Halil Pasic <pasic@linux.vnet.ibm.com>
> >> Reported-by: Michael A. Tebolt <miket@us.ibm.com>
> >> Reported-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> >> Fixes: commit 2751c9882b94 ("vhost: cross-endian support for legacy devices")
> >> ---
> > Reviewed-by: Greg Kurz <groug@kaod.org>
> >
>
> Thanks!
>
> We have some tests on s390x (that is BE) running, but I won't be able to
> test the change with cross endian and legacy.
>
> What do you think, should I/we RFT or are we fine without?
>
> Regards,
> Halil
More testing can't hurt. I can merge this meanwhile.
--
MST
next prev parent reply other threads:[~2017-01-31 18:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-30 10:09 [PATCH] vhost: fix initialization for vq->is_le Halil Pasic
2017-01-30 19:06 ` Greg Kurz
[not found] ` <20170130200658.73f8dab6@bahia.lan>
2017-01-31 15:56 ` Halil Pasic
2017-01-31 18:28 ` Michael S. Tsirkin [this message]
2017-02-01 14:29 ` Halil Pasic
2017-02-01 14:19 ` Greg Kurz
2017-02-04 2:27 ` Jason Wang
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=20170131202817-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=dgilbert@redhat.com \
--cc=groug@kaod.org \
--cc=kvm@vger.kernel.org \
--cc=miket@us.ibm.com \
--cc=pasic@linux.vnet.ibm.com \
--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).