From: Eli Cohen <elic@nvidia.com>
To: Jason Wang <jasowang@redhat.com>, "mst@redhat.com" <mst@redhat.com>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"virtualization@lists.linux-foundation.org"
<virtualization@lists.linux-foundation.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Anirudh Rayabharam <mail@anirudhrb.com>
Subject: RE: [PATCH] vhost: allow batching hint without size
Date: Thu, 10 Mar 2022 10:59:33 +0000 [thread overview]
Message-ID: <DM8PR12MB5400C4168D42B9B2AB804358AB0B9@DM8PR12MB5400.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20220310075211.4801-1-jasowang@redhat.com>
Tested-by: Eli Cohen <elic@nvidia.com>
> -----Original Message-----
> From: Jason Wang <jasowang@redhat.com>
> Sent: Thursday, March 10, 2022 9:52 AM
> To: mst@redhat.com
> Cc: kvm@vger.kernel.org; virtualization@lists.linux-foundation.org; netdev@vger.kernel.org; linux-kernel@vger.kernel.org; Jason Wang
> <jasowang@redhat.com>; Eli Cohen <elic@nvidia.com>; Anirudh Rayabharam <mail@anirudhrb.com>
> Subject: [PATCH] vhost: allow batching hint without size
>
> Commit e2ae38cf3d91 ("vhost: fix hung thread due to erroneous iotlb
> entries") tries to reject the IOTLB message whose size is zero. But
> the size is not necessarily meaningful, one example is the batching
> hint, so the commit breaks that.
>
> Fixing this be reject zero size message only if the message is used to
> update/invalidate the IOTLB.
>
> Fixes: e2ae38cf3d91 ("vhost: fix hung thread due to erroneous iotlb entries")
> Reported-by: Eli Cohen <elic@nvidia.com>
> Cc: Anirudh Rayabharam <mail@anirudhrb.com>
> Signed-off-by: Jason Wang <jasowang@redhat.com>
> ---
> drivers/vhost/vhost.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
> index 082380c03a3e..1768362115c6 100644
> --- a/drivers/vhost/vhost.c
> +++ b/drivers/vhost/vhost.c
> @@ -1170,7 +1170,9 @@ ssize_t vhost_chr_write_iter(struct vhost_dev *dev,
> goto done;
> }
>
> - if (msg.size == 0) {
> + if ((msg.type == VHOST_IOTLB_UPDATE ||
> + msg.type == VHOST_IOTLB_INVALIDATE) &&
> + msg.size == 0) {
> ret = -EINVAL;
> goto done;
> }
> --
> 2.18.1
prev parent reply other threads:[~2022-03-10 10:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-10 7:52 [PATCH] vhost: allow batching hint without size Jason Wang
2022-03-10 10:59 ` Eli Cohen [this message]
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=DM8PR12MB5400C4168D42B9B2AB804358AB0B9@DM8PR12MB5400.namprd12.prod.outlook.com \
--to=elic@nvidia.com \
--cc=jasowang@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mail@anirudhrb.com \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--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).