From patchwork Fri Oct 23 11:04:38 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 55540 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9NB71Sb026114 for ; Fri, 23 Oct 2009 11:07:01 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751617AbZJWLGz (ORCPT ); Fri, 23 Oct 2009 07:06:55 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751560AbZJWLGz (ORCPT ); Fri, 23 Oct 2009 07:06:55 -0400 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 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n9NB6wjV030986; Fri, 23 Oct 2009 07:06:58 -0400 Received: from redhat.com (vpn-6-107.tlv.redhat.com [10.35.6.107]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id n9NB6qBB003994; Fri, 23 Oct 2009 07:06:54 -0400 Date: Fri, 23 Oct 2009 13:04:38 +0200 From: "Michael S. Tsirkin" To: Sridhar Samudrala Cc: Shirley Ma , Shirley Ma , David Stevens , kvm@vger.kernel.org, sri@linux.vnet.ibm.com, mashirle@linux.vnet.ibm.com Subject: Re: vhost-net patches 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-Disposition: inline In-Reply-To: <1256234420.27706.5.camel@w-sridhar.beaverton.ibm.com> User-Agent: Mutt/1.5.19 (2009-01-05) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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)