From: Harry Butterworth <harry@hebutterworth.freeserve.co.uk>
To: Ian Pratt <m+Ian.Pratt@cl.cam.ac.uk>
Cc: xen-devel@lists.xensource.com, mark.williamson@cl.cam.ac.uk,
keir.fraser@cl.cam.ac.uk, sanjay.kushwaha@gmail.com
Subject: RE: USB virt status --- Help please!!!
Date: Sun, 13 Nov 2005 18:28:18 +0000 [thread overview]
Message-ID: <1131906498.7898.20.camel@localhost> (raw)
In-Reply-To: <A95E2296287EAD4EB592B5DEEFCE0E9D32E930@liverpoolst.ad.cl.cam.ac.uk>
> > I'm in the middle of debugging a problem where dom0 reboots
> > when flushing a big file to the USB key. I didn't manage to
> > find a serial cable for a serial console this evening so I
> > don't have much to go on yet.
>
> You could try 'noreboot' and stick to a text mode.
Thanks, yes this worked.
It turns out that dom0 is bombing out in dma_map_single
(arch/xen/i386/kernel/pci-dma.c) with a failure of
range_straddles_page_boundary and if I use swiotlb=force on the command
line as suggested by the printk then it all seems to work fine.
Looking at the kernel documentation for the DMA api I get the impression
that dma_map_single ought to work across page boundaries provided the
pages are contiguous in physical memory. Given that the code seems to
work writing and verifying large random files with swiotlb=force I think
I'm probably not getting the addresses wrong and I'm assuming that if
the memory was good enough for the USB driver in the FE it ought to be
good enough for the USB driver in the BE.
So, to me this looks like a bug in the xen implementation of
dma_map_single which I think ought to not fail just because of crossing
a page boundary but only if the memory is discontiguous.
But, I don't really know enough about the memory model to know if this
is right.
So, I need to know what I ought to be doing with the USB memory mapping.
Currently, I'm taking the FE pointer to the memory buffer and creating a
grant reference for each page spanned by the request then mapping them
into the BE address space in an empty page range taken from the balloon
driver. This is the same as the block driver where I copied the code
from.
Then I pass the address of the start of the buffer in the empty page
range in the URB to the usb core.
Is this the right approach? Is the check in dma_map_single overzealous?
Harry.
next prev parent reply other threads:[~2005-11-13 18:28 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-11 23:23 USB virt status Ian Pratt
2005-11-13 18:28 ` Harry Butterworth [this message]
2005-11-14 9:56 ` USB virt status --- Help please!!! Keir Fraser
2005-11-14 10:12 ` harry
2005-11-14 10:27 ` harry
2005-11-14 10:33 ` Keir Fraser
2005-11-14 17:30 ` Stephen C. Tweedie
2005-11-14 18:42 ` Keir Fraser
2005-11-14 18:50 ` Stephen C. Tweedie
2005-11-14 20:36 ` Harry Butterworth
2005-11-14 21:00 ` Muli Ben-Yehuda
2005-11-14 21:46 ` Muli Ben-Yehuda
2005-11-15 10:23 ` Keir Fraser
2005-11-15 19:14 ` Muli Ben-Yehuda
-- strict thread matches above, loose matches on Subject: below --
2005-11-15 22:36 Ian Pratt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1131906498.7898.20.camel@localhost \
--to=harry@hebutterworth.freeserve.co.uk \
--cc=keir.fraser@cl.cam.ac.uk \
--cc=m+Ian.Pratt@cl.cam.ac.uk \
--cc=mark.williamson@cl.cam.ac.uk \
--cc=sanjay.kushwaha@gmail.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.