From: Keir Fraser Subject: Re: Question regarding SLAB corruption Date: Mon, 09 Jul 2007 09:31:16 +0100 Message-ID: References: <20070709073804.GZ3885@ics.muni.cz> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20070709073804.GZ3885@ics.muni.cz> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Lukas Hejtmanek Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 9/7/07 08:38, "Lukas Hejtmanek" wrote: > On Sun, Jul 08, 2007 at 11:11:58AM +0100, Keir Fraser wrote: >> DomU sets up its own DMAs. The BARs do not come into it (except that they >> will indicate where device registers are, and that's how the DMA is >> programmed). > > One of maintainers of IB driver suggested a theory. What is the way that Xen > allocates memory? Are there guarantees about allocation of physical contiguous > memory? E.g., if I request alloc_pages(GPF_KERNEL, 6) - (256kB), are these > pages physically contiguous? Or are these pages guest contiguous only? Nope. To get contiguous pages on Xen you need to use pci_alloc_consistent, or pci_map_single, or similar. Most drivers are okay with this, because you are not supposed to program DMA without having got a dma_addr_t from Linux's DMA API, and we hook into the DMA API to serve up contiguous regions (via the swiotlb [ie. bounce buffers], if necessary). -- Keir