From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: vhost-net patches Date: Fri, 23 Oct 2009 13:04:38 +0200 Message-ID: <20091023110438.GA20229@redhat.com> References: <20091020173259.GA14639@redhat.com> <20091021201923.GA25520@redhat.com> <20091022123456.GA6682@redhat.com> <20091022131332.GB6961@redhat.com> <1256232224.6601.17.camel@localhost.localdomain> <20091022174344.GA10821@redhat.com> <1256234420.27706.5.camel@w-sridhar.beaverton.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Shirley Ma , Shirley Ma , David Stevens , kvm@vger.kernel.org, sri@linux.vnet.ibm.com, mashirle@linux.vnet.ibm.com To: Sridhar Samudrala Return-path: Received: from mx1.redhat.com ([209.132.183.28]:43940 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751204AbZJWLGy (ORCPT ); Fri, 23 Oct 2009 07:06:54 -0400 Content-Disposition: inline In-Reply-To: <1256234420.27706.5.camel@w-sridhar.beaverton.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Oct 22, 2009 at 11:00:20AM -0700, Sridhar Samudrala wrote: > On Thu, 2009-10-22 at 19:43 +0200, Michael S. Tsirkin wrote: > > > > > Possibly we'll have to debug this in vhost in host kernel. > > I would debug this directly, it's just that my setup is somehow > > different and I do not see this issue, otherwise I would not > > waste your time. > > > > Can we add some printks? > > handle_tx has this at the top: > > > > if (!sock || !sock_writeable(sock->sk)) > > return; > > I added some debug printks in handle_rx and handle_tx > get_user() calls are failing with EFAULT. Sridhar, Shirley, Could you please test the following patch? It should fix a bug on 32 bit hosts - is this what you have? diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 5b57697..9d856e9 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -286,11 +286,11 @@ static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp) r = -EOPNOTSUPP; break; } - if ((u64)(long)a.user_addr != a.user_addr) { + if ((u64)(unsigned long)a.user_addr != a.user_addr) { r = -EFAULT; break; } - vq->desc = (void __user *)(long)a.user_addr; + vq->desc = (void __user *)(unsigned long)a.user_addr; break; case VHOST_SET_VRING_AVAIL: r = copy_from_user(&a, argp, sizeof a); @@ -300,11 +300,11 @@ static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp) r = -EOPNOTSUPP; break; } - if ((u64)(long)a.user_addr != a.user_addr) { + if ((u64)(unsigned long)a.user_addr != a.user_addr) { r = -EFAULT; break; } - vq->avail = (void __user *)(long)a.user_addr; + vq->avail = (void __user *)(unsigned long)a.user_addr; /* Forget the cached index value. */ vq->avail_idx = vq->last_avail_idx; break; @@ -316,11 +316,11 @@ static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp) r = -EOPNOTSUPP; break; } - if ((u64)(long)a.user_addr != a.user_addr) { + if ((u64)(unsigned long)a.user_addr != a.user_addr) { r = -EFAULT; break; } - vq->used = (void __user *)(long)a.user_addr; + vq->used = (void __user *)(unsigned long)a.user_addr; r = init_used(vq); if (r) break; @@ -389,7 +389,7 @@ static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp) if (pollstop && vq->handle_kick) vhost_poll_flush(&vq->poll); - return 0; + return r; } long vhost_dev_ioctl(struct vhost_dev *d, unsigned int ioctl, unsigned long arg)