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] x86 swiotlb questions

To: Jan Beulich <jbeulich@xxxxxxxxxx>, Keir Fraser <keir@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] x86 swiotlb questions
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Sat, 23 Dec 2006 09:48:44 +0000
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Sat, 23 Dec 2006 01:48:57 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <458C13DC.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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Accmd4i2xw/5spJqEduyIQANk04WTA==
Thread-topic: [Xen-devel] x86 swiotlb questions
User-agent: Microsoft-Entourage/11.3.2.061213
Firstly, I think we should wait and see if the patches are acceptable
upstream in their current form before switching to using them.

As for dma_alloc_coherent() -- yes it makes sense to make an allocation
request with the device's specified bit width. And we could be opportunistic
about the bit width we advertise from swiotlb if we happen to get lower
memory than we asked for. *but*:
 1. Our swiotlb is made up of separately allocated strides, so the swiotlb
is not contiguous in machine memory. That needs to be kept in mind when
calculating the bit width as it'll be max over all strides.
 2. Also because of this, the existing swiotlb_dma_supported() cannot work
as is. Firstly it would need to use virt_to_machine(), and even then it
doesn't take into account that the aperture is not contiguous in machine
memory.

And as I said before, dma_bits will disappear from Xen in due course when
the dma pool goes away and is replaced with something more flexible. The
plan is to leave it (or a similarly-named parameter) in Linux, at least as a
guide to the swiotlb pre-allocation (even if no longer used for
dma_alloc_coherent).

 -- Keir

On 22/12/06 4:20 pm, "Jan Beulich" <jbeulich@xxxxxxxxxx> wrote:

> One more thing: Is it really necessary to restrict dma_alloc_coherent() to
> dma_bits?
> I.e., couldn't we, once the bit-level page allocator is merged, use the real
> bit width
> needed for the requesting device here? If not, this would then permit using
> the
> original implementation of swiotlb_dma_supported() (as dma_alloc_coherent()
> then
> no longer depends on dma_bits), and perhaps even auto-setting dma_bits based
> on what memory we can get out of Xen in swiotlb_init(), making the mismatching
> of
> command line options (between Xen and kernel) impossible (the kernel simply
> wouldn't have one anymore).
> 
> As a nice side effect, using the original implementation of
> swiotlb_dma_supported()
> would require slightly less tweaking of lib/swiotlb.c, hence slightly raising
> the
> chances of the changes getting accepted into mainline. And clearly, if the
> kernel
> manages to allocate the swiotlb at an address with less than dma_bits bits,
> there
> seems to be no reason to refuse use of I/O devices that the actual buffer
> fits, but
> dma_bits doesn't.



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