From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: USB Passthrough 1.1 performance problem... Date: Tue, 14 Dec 2010 12:02:03 +0200 Message-ID: <4D07409B.2080602@redhat.com> References: <4D04B645.3010100@brakkee.org> <4D0537A8.8000607@brakkee.org> <4D0549AA.2020007@web.de> <4D054D37.7040107@brakkee.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Erik Brakkee , Jan Kiszka , kvm@vger.kernel.org To: Alexander Graf Return-path: Received: from mx1.redhat.com ([209.132.183.28]:8497 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754311Ab0LNKCL (ORCPT ); Tue, 14 Dec 2010 05:02:11 -0500 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 12/13/2010 10:25 AM, Alexander Graf wrote: > >> > > Is your point in this case that USB in a VM based on PCI passthrough will always have problems when it comes to more real-time issues or does this only apply to USB passthrough? I can imagine that PCI passthrough is better since it uses hardware support. By the way, I have seen issues in the past whereby the tv card stopped working because of high load on the server running natively so real-time issues also exist apart from virtualization. > > IIRC the reason that PCI passthrough with EHCI performs as badly as it does is that BARs< 4k get passed through using the slow path (trap to qemu, issue MMIO in user space). Unfortunately, EHCI seems to have a 256 byte BAR region usually that is used for some handshaking: > > 00:12.2 USB Controller: ATI Technologies Inc SB700/SB800 USB EHCI Controller (prog-if 20 [EHCI]) > Subsystem: ATI Technologies Inc SB700/SB800 USB EHCI Controller > Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- > Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium>TAbort-SERR- Latency: 64, Cache Line Size: 64 bytes > Interrupt: pin B routed to IRQ 17 > Region 0: Memory at c8014400 (32-bit, non-prefetchable) [size=256] > That could certainly be optimized. If the BAR is all along in its page, both on guest and host (if not, we can migrate it, at least on the host), we can use the same offset within the page on the host as it appears on the guest, and assign the entire page. We should make sure SeaBIOS uses a minimum alignment of 4k for mmio BARs. -- error compiling committee.c: too many arguments to function