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] Question regarding SLAB corruption

To: Keir Fraser <keir@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] Question regarding SLAB corruption
From: Lukas Hejtmanek <xhejtman@xxxxxxxxxxx>
Date: Mon, 9 Jul 2007 15:24:49 +0200
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Mon, 09 Jul 2007 06:21:40 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <C2B7ECF7.12164%keir@xxxxxxxxxxxxx>
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>
References: <20070709120734.GH3885@xxxxxxxxxxx> <C2B7ECF7.12164%keir@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.16 (2007-06-11)
On Mon, Jul 09, 2007 at 01:47:34PM +0100, Keir Fraser wrote:
> Well, we currently assume that segments of a scatterlist (as passed to
> pci_map_sg) do not cross page boundaries. It looks like this assumption is
> broken (certainly for the infiniband driver!).
> 
> I've just checked in the attached patch to fix this issue. Please give it a
> try in your dom0 tree.

for some reason, insmod/rmmod works fine even without the patch in Dom0. The
patch wasn't applied cleanly anyway, I'm using stock Xen 3.1 which does not 
have the code:

dma = gnttab_dma_map_page(virt_to_page(ptr)) +                  
                      offset_in_page(ptr); 

Anyway, in DomU it produced message (but also an oops):
Fatal DMA error! Please use 'swiotlb=force'
----------- cut here --------- please bite here ---------
Kernel BUG at arch/x86_64/kernel/../../i386/kernel/pci-dma-xen.c:100

> > I did debug like this - so it prints physical and virtual addresses and they
> > seems to be perfectly contiguous. Are the physical addresses real physical
> > addresses or virtualized by Xen hypervisor?
> 
> You want to use virt_to_machine(). As you say, the addresses returned by
> virt_to_phys() are virtual-physical, which is not what you want.

Well, we got it. The virt_to_machine shows that although the pages are 
contiguous, they are in the reversed order! As can be seen below. Should the 
swiotlb=force solve the problem?

ib_mthca 0000:08:00.0: Alloc pages starts
ib_mthca 0000:08:00.0: Page phys. addr 0000000025455000, virt ffff880099d40000
ib_mthca 0000:08:00.0: Page phys. addr 0000000025454000, virt ffff880099d41000
ib_mthca 0000:08:00.0: Page phys. addr 0000000025453000, virt ffff880099d42000
ib_mthca 0000:08:00.0: Page phys. addr 0000000025452000, virt ffff880099d43000
ib_mthca 0000:08:00.0: Page phys. addr 0000000025451000, virt ffff880099d44000
ib_mthca 0000:08:00.0: Page phys. addr 0000000025450000, virt ffff880099d45000
ib_mthca 0000:08:00.0: Page phys. addr 000000002544f000, virt ffff880099d46000
ib_mthca 0000:08:00.0: Page phys. addr 000000002544e000, virt ffff880099d47000
ib_mthca 0000:08:00.0: Page phys. addr 000000002544d000, virt ffff880099d48000
ib_mthca 0000:08:00.0: Page phys. addr 000000002544c000, virt ffff880099d49000
ib_mthca 0000:08:00.0: Page phys. addr 000000002544b000, virt ffff880099d4a000
ib_mthca 0000:08:00.0: Page phys. addr 000000002544a000, virt ffff880099d4b000

-- 
Lukáš Hejtmánek

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