WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] question on c/s 15181

To: "Herbert Xu" <herbert@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] question on c/s 15181
From: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Date: Thu, 05 Jul 2007 13:53:27 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 05 Jul 2007 05:50:16 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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 == DMA_NONE);
 
        for (i = 0; i < nelems; i++, sg++)
-               if (sg->dma_address != SG_ENT_PHYS_ADDRESS(sg))
+               if (in_swiotlb_aperture(sg->dma_address))
                        unmap_single(hwdev, 
                                     (void *)bus_to_virt(sg->dma_address),
                                     sg->dma_length, dir);
+               else
+                       gnttab_dma_unmap_page(sg->dma_address);
 }
 
 /*
@@ -627,7 +634,7 @@ swiotlb_sync_sg_for_cpu(struct device *h
        BUG_ON(dir == DMA_NONE);
 
        for (i = 0; i < nelems; i++, sg++)
-               if (sg->dma_address != 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 == DMA_NONE);
 
        for (i = 0; i < nelems; i++, sg++)
-               if (sg->dma_address != 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);



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>