|
|
|
|
|
|
|
|
|
|
xen-devel
RE: [Xen-devel] [PATCH] Retry 3: Use i386 swiotlb code in lib/swiotlb-xe
> >>> "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
|
|
|
|
|