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-ia64-devel

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

To: Alex Williamson <alex.williamson@xxxxxx>
Subject: Re: [Xen-ia64-devel] [PATCH 0/7] gnttab unmap_and_repace
From: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Date: Wed, 13 Jun 2007 12:55:15 +0900
Cc: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 12 Jun 2007 20:53:17 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <1181705298.6221.548.camel@bling>
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20070612052131.GA18845%yamahata@xxxxxxxxxxxxx> <1181705298.6221.548.camel@bling>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.2.1i
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

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