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
|