[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-ia64-devel] [PATCH 0/7] gnttab unmap_and_repace



On Tue, Jun 12, 2007 at 09:28:18PM -0600, Alex Williamson wrote:
>    I took a little different strategy for the sba_iommu patch, but I
> applied all the others.  Let me know if you see any problems with the
> changes I made to sba_iommu.  Thanks for getting the tree working!

Hi Alex. It looks pretty good except one.

@@ -902,7 +923,21 @@ sba_map_single(struct device *dev, void 
 #endif
 #ifdef ALLOW_IOV_BYPASS
        unsigned long pci_addr = virt_to_bus(addr);
-
+#endif
+
+#ifdef CONFIG_XEN
+       if (is_running_on_xen()) {
+               void* tmp_addr = addr;
+               size_t tmp_size = size;
+               do {
+                       gnttab_dma_use_page(virt_to_page(tmp_addr));
+                       tmp_addr += PAGE_SIZE;
+                       tmp_size -= min(tmp_size, PAGE_SIZE);
+               } while (tmp_size);
+       }
+#endif
+
+#ifdef ALLOW_IOV_BYPASS
        ASSERT(to_pci_dev(dev)->dma_mask);
        /*
        ** Check if the PCI device can DMA to ptr... if so, just return ptr


pci_addr = virt_to_bus() must be after gnttab_dma_use_page() loop.
Otherwise gnttab unmap_and_replace may happen between them.
-- 
yamahata

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.