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

RE: [Xen-devel] [PATCH] Retry 3: Use i386 swiotlb code in lib/swiotlb-xe

To: "Jan Beulich" <jbeulich@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: RE: [Xen-devel] [PATCH] Retry 3: Use i386 swiotlb code in lib/swiotlb-xen.c [2/2]
From: "Langsdorf, Mark" <mark.langsdorf@xxxxxxx>
Date: Tue, 27 Feb 2007 14:30:46 -0600
Delivery-date: Tue, 27 Feb 2007 12:30:07 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <45E3FB43.76E4.0078.0@xxxxxxxxxx>
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>
References: <1449F58C868D8D4E9C72945771150BDFD9666B@xxxxxxxxxxxxxxxxx> <45E3FB43.76E4.0078.0@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcdaSiv8kB5VtWIdQCaba/SK/GMXNAAY56LA
Thread-topic: [Xen-devel] [PATCH] Retry 3: Use i386 swiotlb code in lib/swiotlb-xen.c [2/2]
> >>> "Langsdorf, Mark" <mark.langsdorf@xxxxxxx> 26.02.07 21:37 >>>
> >Move the arch/i386/kernel/swiotlb.c code to lib/swiotlb-xen.c
> >code in order to simplify maintenance of Xen in the future.
> >
> >The first patch simply moves the code to lib/swiotlb-xen.c;
> 
> Without the lib/Makefile adjustment the first patch can't work without
> the second one.

Okay.
 
> >--- a/linux-2.6-xen-sparse/lib/swiotlb-xen.c Mon Feb 26 
> 15:52:16 2007 -0600
> >+++ b/linux-2.6-xen-sparse/lib/swiotlb-xen.c Mon Feb 26 
> 15:58:43 2007 -0600
> >...
> >+void
> >+swiotlb_free_coherent(struct device *hwdev, size_t size, 
> void *vaddr,
> >+                    dma_addr_t dma_handle)
> >+{
> >+    if (in_swiotlb_aperture((dma_addr_t) vaddr))
> >+            free_pages((unsigned long) vaddr, get_order(size));
> >+    else
> >+            /* DMA_TO_DEVICE to avoid memcpy in unmap_single */
> >+            swiotlb_unmap_single (hwdev, dma_handle, size, 
> DMA_TO_DEVICE);
> >+}
> 
> I'm pretty certain this is wrong: dma_handle is what should be passed
> to in_swiotlb_aperture().

The original code is 
        if (!(vaddr >= (void *)io_tlb_start) && vaddr < (void *)
io_tlb_end))
                free_pages((unsigned long) vaddr, get_order(size));

I can't see why I wouldn't check the vaddr address in Xen, also.

-Mark Langsdorf
AMD, Inc.



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