From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753922AbeDKNvf (ORCPT ); Wed, 11 Apr 2018 09:51:35 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:39840 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753105AbeDKNvd (ORCPT ); Wed, 11 Apr 2018 09:51:33 -0400 Date: Wed, 11 Apr 2018 16:51:32 +0300 From: "Michael S. Tsirkin" To: Eric Auger Cc: eric.auger.pro@gmail.com, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, kvm@vger.kernel.org, jasowang@redhat.com, kvmarm@lists.cs.columbia.edu, stefanha@redhat.com Subject: Re: [PATCH] vhost: Fix vhost_copy_to_user() Message-ID: <20180411165116-mutt-send-email-mst@kernel.org> References: <1523453438-4266-1-git-send-email-eric.auger@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1523453438-4266-1-git-send-email-eric.auger@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 11, 2018 at 03:30:38PM +0200, Eric Auger wrote: > vhost_copy_to_user is used to copy vring used elements to userspace. > We should use VHOST_ADDR_USED instead of VHOST_ADDR_DESC. > > Fixes: f88949138058 ("vhost: introduce O(1) vq metadata cache") > Signed-off-by: Eric Auger Acked-by: Michael S. Tsirkin > --- > > This fixes a stall observed when running an aarch64 guest with > virtual smmu > --- > drivers/vhost/vhost.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c > index bec722e..f44aead 100644 > --- a/drivers/vhost/vhost.c > +++ b/drivers/vhost/vhost.c > @@ -744,7 +744,7 @@ static int vhost_copy_to_user(struct vhost_virtqueue *vq, void __user *to, > struct iov_iter t; > void __user *uaddr = vhost_vq_meta_fetch(vq, > (u64)(uintptr_t)to, size, > - VHOST_ADDR_DESC); > + VHOST_ADDR_USED); > > if (uaddr) > return __copy_to_user(uaddr, from, size); > -- > 2.5.5