From owner-svn-src-head@FreeBSD.ORG Wed Aug 6 17:46:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8D4DCBF5 for ; Wed, 6 Aug 2014 17:46:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 635AF2D50 for ; Wed, 6 Aug 2014 17:46:00 +0000 (UTC) Received: from royger (uid 1332) (envelope-from royger@FreeBSD.org) id 5f11 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Wed, 06 Aug 2014 17:46:00 +0000 From: Roger Pau Monné Date: Wed, 6 Aug 2014 17:46:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269634 - in head/sys/dev/drm2: i915 ttm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e269d8.5f11.5b973b7c@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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: Wed, 06 Aug 2014 17:46:00 -0000 Author: royger Date: Wed Aug 6 17:45:59 2014 New Revision: 269634 URL: http://svnweb.freebsd.org/changeset/base/269634 Log: drm: fix usage of vm_phys_fictitious_to_vm_page vm_phys_fictitious_to_vm_page should not be called directly, even when operating on a range that has been registered using vm_phys_fictitious_reg_range. PHYS_TO_VM_PAGE should be used instead because on arches that use VM_PHYSSEG_DENSE the page might come directly from vm_page_array. Reported by: nwhitehorn Tested by: nwhitehorn, David Mackay Sponsored by: Citrix Systems R&D Modified: head/sys/dev/drm2/i915/i915_gem.c head/sys/dev/drm2/ttm/ttm_bo_vm.c Modified: head/sys/dev/drm2/i915/i915_gem.c ============================================================================== --- head/sys/dev/drm2/i915/i915_gem.c Wed Aug 6 17:40:11 2014 (r269633) +++ head/sys/dev/drm2/i915/i915_gem.c Wed Aug 6 17:45:59 2014 (r269634) @@ -1428,8 +1428,10 @@ retry: obj->fault_mappable = true; VM_OBJECT_WLOCK(vm_obj); - m = vm_phys_fictitious_to_vm_page(dev->agp->base + obj->gtt_offset + - offset); + m = PHYS_TO_VM_PAGE(dev->agp->base + obj->gtt_offset + offset); + KASSERT((m->flags & PG_FICTITIOUS) != 0, + ("physical address %#jx not fictitious", + (uintmax_t)(dev->agp->base + obj->gtt_offset + offset))); if (m == NULL) { VM_OBJECT_WUNLOCK(vm_obj); cause = 60; Modified: head/sys/dev/drm2/ttm/ttm_bo_vm.c ============================================================================== --- head/sys/dev/drm2/ttm/ttm_bo_vm.c Wed Aug 6 17:40:11 2014 (r269633) +++ head/sys/dev/drm2/ttm/ttm_bo_vm.c Wed Aug 6 17:45:59 2014 (r269634) @@ -216,8 +216,12 @@ reserve: } if (bo->mem.bus.is_iomem) { - m = vm_phys_fictitious_to_vm_page(bo->mem.bus.base + - bo->mem.bus.offset + offset); + m = PHYS_TO_VM_PAGE(bo->mem.bus.base + bo->mem.bus.offset + + offset); + KASSERT((m->flags & PG_FICTITIOUS) != 0, + ("physical address %#jx not fictitious", + (uintmax_t)(bo->mem.bus.base + bo->mem.bus.offset + + offset))); pmap_page_set_memattr(m, ttm_io_prot(bo->mem.placement)); } else { ttm = bo->ttm;