From: "Jan Beulich" Subject: question on c/s 15181 Date: Thu, 05 Jul 2007 13:53:27 +0100 Message-ID: <468D05E7.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Herbert Xu Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Herbert, are the changes below to use in_swiotlb_aperture() strictly = necessary? They get us further away from native code, so I wonder if, for the purpose = of being as close as possible to native, these could be reverted (in a larger = patch that would get us closer to native in many other respects). Jan ******************************************************** @@ -605,10 +610,12 @@ swiotlb_unmap_sg(struct device *hwdev, s BUG_ON(dir =3D=3D DMA_NONE); =20 for (i =3D 0; i < nelems; i++, sg++) - if (sg->dma_address !=3D SG_ENT_PHYS_ADDRESS(sg)) + if (in_swiotlb_aperture(sg->dma_address)) unmap_single(hwdev,=20 (void *)bus_to_virt(sg->dma_address), sg->dma_length, dir); + else + gnttab_dma_unmap_page(sg->dma_address); } =20 /* @@ -627,7 +634,7 @@ swiotlb_sync_sg_for_cpu(struct device *h BUG_ON(dir =3D=3D DMA_NONE); =20 for (i =3D 0; i < nelems; i++, sg++) - if (sg->dma_address !=3D SG_ENT_PHYS_ADDRESS(sg)) + if (in_swiotlb_aperture(sg->dma_address)) sync_single(hwdev, (void *)bus_to_virt(sg->dma_address), sg->dma_length, dir); @@ -642,7 +649,7 @@ swiotlb_sync_sg_for_device(struct device BUG_ON(dir =3D=3D DMA_NONE); =20 for (i =3D 0; i < nelems; i++, sg++) - if (sg->dma_address !=3D SG_ENT_PHYS_ADDRESS(sg)) + if (in_swiotlb_aperture(sg->dma_address)) sync_single(hwdev, (void *)bus_to_virt(sg->dma_address), sg->dma_length, dir);