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: "Langsdorf, Mark" <mark.langsdorf@xxxxxxx>, 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: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Tue, 27 Feb 2007 20:49:39 +0000
Delivery-date: Tue, 27 Feb 2007 12:49:17 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <1449F58C868D8D4E9C72945771150BDFD96677@xxxxxxxxxxxxxxxxx>
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
Thread-index: AcdaSiv8kB5VtWIdQCaba/SK/GMXNAAY56LAAADAa6g=
Thread-topic: [Xen-devel] [PATCH] Retry 3: Use i386 swiotlb code in lib/swiotlb-xen.c [2/2]
User-agent: Microsoft-Entourage/11.3.3.061214
On 27/2/07 20:30, "Langsdorf, Mark" <mark.langsdorf@xxxxxxx> wrote:

>> 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.

You can either use the vaddr check from original lib/swiotlb.c *or* you can
pass the dma_handle to in_swiotlb_aperture(). You cannot pass a vaddr to
in_swiotlb_aperture(): it makes no sense!

Actually I think the dma_alloc_coherent() you've hauled in from native
x86/64 code won't even work on Xen as it is. The dma_alloc_pages() function
it uses first won't guarantee to return contiguous memory on Xen, but that
is implicitly assumed by the caller.

I'm afraid various rather serious niggles like these make me wary of
applying these patches until they've been very thoroughly audited.

 -- Keir



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