From owner-freebsd-amd64@FreeBSD.ORG Mon Apr 13 19:40:04 2009 Return-Path: Delivered-To: freebsd-amd64@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 275941065675 for ; Mon, 13 Apr 2009 19:40:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 081458FC19 for ; Mon, 13 Apr 2009 19:40:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n3DJe3Fv081586 for ; Mon, 13 Apr 2009 19:40:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n3DJe381081585; Mon, 13 Apr 2009 19:40:03 GMT (envelope-from gnats) Date: Mon, 13 Apr 2009 19:40:03 GMT Message-Id: <200904131940.n3DJe381081585@freefall.freebsd.org> To: freebsd-amd64@FreeBSD.org From: dfilter@FreeBSD.ORG (dfilter service) X-Mailman-Approved-At: Mon, 13 Apr 2009 20:35:17 +0000 Cc: Subject: Re: amd64/133592: commit references a PR X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: dfilter service List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2009 19:40:06 -0000 The following reply was made to PR amd64/133592; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: amd64/133592: commit references a PR Date: Mon, 13 Apr 2009 19:39:17 +0000 (UTC) Author: kib Date: Mon Apr 13 19:20:32 2009 New Revision: 191011 URL: http://svn.freebsd.org/changeset/base/191011 Log: The bus_dmamap_load_uio(9) shall use pmap of the thread recorded in the uio_td to extract pages from, instead of unconditionally use kernel pmap. Submitted by: Jason Harmening (amd64 version) PR: amd64/133592 Reviewed by: scottl (original patch), jhb MFC after: 2 weeks Modified: head/sys/amd64/amd64/busdma_machdep.c head/sys/arm/arm/busdma_machdep.c head/sys/i386/i386/busdma_machdep.c head/sys/ia64/ia64/busdma_machdep.c Modified: head/sys/amd64/amd64/busdma_machdep.c ============================================================================== --- head/sys/amd64/amd64/busdma_machdep.c Mon Apr 13 19:12:28 2009 (r191010) +++ head/sys/amd64/amd64/busdma_machdep.c Mon Apr 13 19:20:32 2009 (r191011) @@ -606,7 +606,10 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm vendaddr = (vm_offset_t)buf + buflen; while (vaddr < vendaddr) { - paddr = pmap_kextract(vaddr); + if (pmap) + paddr = pmap_extract(pmap, vaddr); + else + paddr = pmap_kextract(vaddr); if (run_filter(dmat, paddr) != 0) map->pagesneeded++; vaddr += (PAGE_SIZE - ((vm_offset_t)vaddr & PAGE_MASK)); Modified: head/sys/arm/arm/busdma_machdep.c ============================================================================== --- head/sys/arm/arm/busdma_machdep.c Mon Apr 13 19:12:28 2009 (r191010) +++ head/sys/arm/arm/busdma_machdep.c Mon Apr 13 19:20:32 2009 (r191011) @@ -669,8 +669,8 @@ bus_dmamem_free(bus_dma_tag_t dmat, void } static int -_bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, - bus_size_t buflen, int flags) +_bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, pmap_t pmap, + void *buf, bus_size_t buflen, int flags) { vm_offset_t vaddr; vm_offset_t vendaddr; @@ -689,7 +689,10 @@ _bus_dmamap_count_pages(bus_dma_tag_t dm vendaddr = (vm_offset_t)buf + buflen; while (vaddr < vendaddr) { - paddr = pmap_kextract(vaddr); + if (pmap != NULL) + paddr = pmap_extract(pmap, vaddr); + else + paddr = pmap_kextract(vaddr); if (((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) && run_filter(dmat, paddr) != 0) map->pagesneeded++; @@ -745,7 +748,8 @@ bus_dmamap_load_buffer(bus_dma_tag_t dma bmask = ~(dmat->boundary - 1); if ((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) { - error = _bus_dmamap_count_pages(dmat, map, buf, buflen, flags); + error = _bus_dmamap_count_pages(dmat, map, pmap, buf, buflen, + flags); if (error) return (error); } Modified: head/sys/i386/i386/busdma_machdep.c ============================================================================== --- head/sys/i386/i386/busdma_machdep.c Mon Apr 13 19:12:28 2009 (r191010) +++ head/sys/i386/i386/busdma_machdep.c Mon Apr 13 19:20:32 2009 (r191011) @@ -142,8 +142,8 @@ static bus_addr_t add_bounce_page(bus_dm vm_offset_t vaddr, bus_size_t size); static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage); int run_filter(bus_dma_tag_t dmat, bus_addr_t paddr); -int _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, - bus_size_t buflen, int flags); +int _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, pmap_t pmap, + void *buf, bus_size_t buflen, int flags); #ifdef XEN #undef pmap_kextract @@ -577,8 +577,8 @@ bus_dmamem_free(bus_dma_tag_t dmat, void } int -_bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, - bus_size_t buflen, int flags) +_bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, pmap_t pmap, + void *buf, bus_size_t buflen, int flags) { vm_offset_t vaddr; vm_offset_t vendaddr; @@ -598,7 +598,10 @@ _bus_dmamap_count_pages(bus_dma_tag_t dm vendaddr = (vm_offset_t)buf + buflen; while (vaddr < vendaddr) { - paddr = pmap_kextract(vaddr); + if (pmap) + paddr = pmap_extract(pmap, vaddr); + else + paddr = pmap_kextract(vaddr); if (((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) && run_filter(dmat, paddr) != 0) { map->pagesneeded++; @@ -660,7 +663,7 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm map = &nobounce_dmamap; if ((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) { - error = _bus_dmamap_count_pages(dmat, map, buf, buflen, flags); + error = _bus_dmamap_count_pages(dmat, map, pmap, buf, buflen, flags); if (error) return (error); } Modified: head/sys/ia64/ia64/busdma_machdep.c ============================================================================== --- head/sys/ia64/ia64/busdma_machdep.c Mon Apr 13 19:12:28 2009 (r191010) +++ head/sys/ia64/ia64/busdma_machdep.c Mon Apr 13 19:20:32 2009 (r191011) @@ -527,7 +527,10 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm vendaddr = (vm_offset_t)buf + buflen; while (vaddr < vendaddr) { - paddr = pmap_kextract(vaddr); + if (pmap != NULL) + paddr = pmap_extract(pmap, vaddr); + else + paddr = pmap_kextract(vaddr); if (run_filter(dmat, paddr, 0) != 0) map->pagesneeded++; vaddr += PAGE_SIZE; _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"