From owner-svn-src-head@freebsd.org Thu Feb 23 13:14:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3187CCEA9C6; Thu, 23 Feb 2017 13:14:30 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7C5019D8; Thu, 23 Feb 2017 13:14:29 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1NDETZP069348; Thu, 23 Feb 2017 13:14:29 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1NDETCl069347; Thu, 23 Feb 2017 13:14:29 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201702231314.v1NDETCl069347@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Thu, 23 Feb 2017 13:14:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r314138 - head/sys/dev/xen/gntdev X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Feb 2017 13:14:30 -0000 Author: royger Date: Thu Feb 23 13:14:28 2017 New Revision: 314138 URL: https://svnweb.freebsd.org/changeset/base/314138 Log: xen/gndev: use UOFF_TO_IDX instead of OFF_TO_IDX The Xen grant table device treats the mmap offset parameter as an unsigned type, and as so it must use the newly introduced UOFF_TO_IDX. Sponsored by: Citrix Systems R&D MFC after: 2 weeks X-MFC-with: r313690 Modified: head/sys/dev/xen/gntdev/gntdev.c Modified: head/sys/dev/xen/gntdev/gntdev.c ============================================================================== --- head/sys/dev/xen/gntdev/gntdev.c Thu Feb 23 09:55:55 2017 (r314137) +++ head/sys/dev/xen/gntdev/gntdev.c Thu Feb 23 13:14:28 2017 (r314138) @@ -796,8 +796,8 @@ gntdev_gmap_pg_fault(vm_object_t object, relative_offset = offset - gmap->file_index; - pidx = OFF_TO_IDX(offset); - ridx = OFF_TO_IDX(relative_offset); + pidx = UOFF_TO_IDX(offset); + ridx = UOFF_TO_IDX(relative_offset); if (ridx >= gmap->count || gmap->grant_map_ops[ridx].status != GNTST_okay) return (VM_PAGER_FAIL); @@ -1067,7 +1067,7 @@ mmap_gref(struct per_user_data *priv_use break; vm_page_insert(gref->page, mem_obj, - OFF_TO_IDX(gref->file_index)); + UOFF_TO_IDX(gref->file_index)); count--; } @@ -1207,7 +1207,7 @@ gntdev_mmap_single(struct cdev *cdev, vm if (error != 0) return (EINVAL); - count = OFF_TO_IDX(size); + count = UOFF_TO_IDX(size); gref_start = gntdev_find_grefs(priv_user, *offset, count); if (gref_start) {