linux-sg2042/drivers/usb/mon
Pete Zaitcev 4e9e920035 USB: usbmon: end ugly tricks with DMA peeking
This patch fixes crashes when usbmon attempts to access GART aperture.
The old code attempted to take a bus address and convert it into a
virtual address, which clearly was impossible on systems with actual
IOMMUs. Let us not persist in this foolishness, and use transfer_buffer
in all cases instead.

I think downsides are negligible. The ones I see are:
 - A driver may pass an address of one buffer down as transfer_buffer,
   and entirely different entity mapped for DMA, resulting in misleading
   output of usbmon. Note, however, that PIO based controllers would
   do transfer the same data that usbmon sees here.
 - Out of tree drivers may crash usbmon if they store garbage in
   transfer_buffer. I inspected the in-tree drivers, and clarified
   the documentation in comments.
 - Drivers that use get_user_pages will not be possible to monitor.
   I only found one driver with this problem (drivers/staging/rspiusb).
 - Same happens with with usb_storage transferring from highmem, but
   it works fine on 64-bit systems, so I think it's not a concern.
   At least we don't crash anymore.

Why didn't we do this in 2.6.10? That's because back in those days
it was popular not to fill in transfer_buffer, so almost all
traffic would be invisible (e.g. all of HID was like that).
But now, the tree is almost 100% PIO friendly, so we can do the
right thing at last.

Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-23 06:46:19 -07:00
..
Kconfig USB: usbmon: drop Kconfig defaults 2009-09-23 06:46:19 -07:00
Makefile USB: usbmon: end ugly tricks with DMA peeking 2009-09-23 06:46:19 -07:00
mon_bin.c USB: usbmon: end ugly tricks with DMA peeking 2009-09-23 06:46:19 -07:00
mon_main.c USB: usbmon: end ugly tricks with DMA peeking 2009-09-23 06:46:19 -07:00
mon_stat.c USB: usbmon: use simple_read_from_buffer() 2008-07-21 15:16:31 -07:00
mon_text.c USB: usbmon: end ugly tricks with DMA peeking 2009-09-23 06:46:19 -07:00
usb_mon.h USB: usbmon: end ugly tricks with DMA peeking 2009-09-23 06:46:19 -07:00