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 21:21:03 +0000
Delivery-date: Tue, 27 Feb 2007 13:20:04 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <C20A49E3.2F28%Keir.Fraser@xxxxxxxxxxxx>
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/GMXNAAY56LAAADAa6gAARi9Jg==
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:49, "Keir Fraser" <Keir.Fraser@xxxxxxxxxxxx> wrote:

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

Perhaps it would be best to focus on just the changes required to meet your
main objective, which (I think?) is to move Xen x86/64 over to dma_ops so
that you can conveniently slide the AMD GART implementation in place of the
swiotlb. If this is the case, relocating swiotlb.c to lib/swiotlb-xen.c and
doing a halfway merge with lib/swiotlb.c is not really on the critical path.
Moreover, Jan has some patches pending for mainline Linux which will change
things around in that area anyway if they get accepted. Now is probably not
the time to churn the swiotlb.c code.

Instead can you not just define a swiotlb-based dma_mapping_ops structure in
a suitable arch/x86_64 file (e.g., pci-swiotlb-xen.c would be an obvious
place) and then work on moving us towards using dma_ops hooks for all the
dma-mapping operations. You could do this latter step piecemeal across a
number of patches if you like (i.e., so that intermediate steps some dma
operations are using the dma_ops hooks while others are still statically
falling back to calling into swiotlb code directly). Probably you'd start
off taking a copy of i386/kernel/pci-dma-xen.c into x86_64, and then
progressively pull in dma_ops logic from x86_64/kernel/pci_dma.c. At the
same time you'd be progressively reintroducing dma_ops usage into
mach-xen/asm/dma-mapping.h as well.

 -- Keir



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