From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:33201) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QVKO2-0001az-L8 for qemu-devel@nongnu.org; Sat, 11 Jun 2011 05:21:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QVKO1-0002LT-2G for qemu-devel@nongnu.org; Sat, 11 Jun 2011 05:21:46 -0400 Received: from fmmailgate03.web.de ([217.72.192.234]:60928) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QVKO0-0002LK-Lm for qemu-devel@nongnu.org; Sat, 11 Jun 2011 05:21:45 -0400 Message-ID: <4DF33383.30307@web.de> Date: Sat, 11 Jun 2011 11:21:07 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <20110611090523.29022.40154.malonedeb@soybean.canonical.com> <20110611090523.29022.40154.malonedeb@soybean.canonical.com> In-Reply-To: <20110611090523.29022.40154.malonedeb@soybean.canonical.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigC8620B2B51AEB99FBD848549" Sender: jan.kiszka@web.de Subject: Re: [Qemu-devel] =?utf-8?q?=5BBug_795866=5D_=5BNEW=5D_pci_passthrough?= =?utf-8?q?_doesn=C2=B4t_work?= List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bug 795866 <795866@bugs.launchpad.net> Cc: qemu-devel@nongnu.org, kvm This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigC8620B2B51AEB99FBD848549 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 2011-06-11 11:05, steo wrote: > Public bug reported: >=20 > Hi all, >=20 > I have some problems passing through a pci device to kvm guest. > First I have to say that I=C2=B4m using the latest kvm-kernel und qemu-= kvm from git-tree (Date 11.06.2011). >=20 > I want=C2=B4t to passthrough this device to guest: >=20 > lspci-output: >=20 > 02:00.0 Multimedia video controller: Micronas Semiconductor Holding AG > Device 0720 (rev 01) >=20 > So at first I have bind the driver to psi-stub: >=20 > modprobe -r kvm-intel > modprobe -r kvm > echo "18c3 0720" > /sys/bus/pci/drivers/pci-stub/new_id > echo 0000:02:00.0 > /sys/bus/pci/devices/0000:02:00.0/driver/unbind > echo 0000:02:00.0 > /sys/bus/pci/drivers/pci-stub/bind > modprobe kvm > modprobe kvm-intel >=20 > Then I have assigned device to guest: > -device pci-assign,host=3D02:00.0 >=20 > When I start the guest. The device succesfully get=C2=B4s an msi-IRQ on= host- > system: >=20 > cat /proc/interrupt output: >=20 > 32: 0 0 0 0 PCI-MSI-edge > kvm_assigned_msi_device >=20 >=20 > On guest device is visibel: >=20 > lspci output: > 00:04.0 Multimedia video controller: Micronas Semiconductor Holding AG = Device 0720 (rev 01) >=20 >=20 > Sometimes the device (on guest) get=C2=B4s an IRQ between 10-16: >=20 > 00:05.0 Multimedia video controller: Micronas Semiconductor Holding AG = Device 0720 (rev 01) > Subsystem: Micronas Semiconductor Holding AG Device dd00 > Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- Par= Err- Stepping- SERR- FastB2B- DisINTx+ > Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=3Dfast >TAbort= - SERR- Interrupt: pin A routed to IRQ 11 > Region 0: Memory at f2050000 (32-bit, non-prefetchable) [size=3D= 64K] > Region 1: Memory at f2060000 (32-bit, non-prefetchable) [size=3D= 64K] > Capabilities: [58] Express (v1) Endpoint, MSI 00 > DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s = <64ns, L1 <1us > ExtTag- AttnBtn- AttnInd- PwrInd- RBE- FLReset-= > DevCtl: Report errors: Correctable- Non-Fatal- Fatal- U= nsupported- > RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+ > MaxPayload 128 bytes, MaxReadReq 128 bytes > DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr= - TransPend- > LnkCap: Port #0, Speed 2.5GT/s, Width x1, ASPM L0s, Lat= ency L0 unlimited, L1 unlimited > ClockPM- Suprise- LLActRep- BwNot- > LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- = CommClk+ > ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt- > LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk-= DLActive- BWMgmt- ABWMgmt- > Capabilities: [40] Power Management version 2 > Flags: PMEClk- DSI- D1- D2- AuxCurrent=3D0mA PME(D0-,D1= -,D2-,D3hot-,D3cold-) > Status: D0 PME-Enable- DSel=3D0 DScale=3D0 PME- > Capabilities: [48] Message Signalled Interrupts: Mask- 64bit- Q= ueue=3D0/0 Enable- > Address: 00000000 Data: 0000 > Kernel modules: ngene >=20 >=20 > In this case the kernel-modul (ngene) can not access the device: >=20 > dmesg | grep ngene >=20 > [ 69.977900] ngene 0000:00:05.0: PCI INT A -> Link[LNKA] -> GSI 11 (l= evel, high) -> IRQ 11 > [ 69.977909] ngene: Found Linux4Media cineS2 DVB-S2 Twin Tuner (v5) > [ 69.978962] ngene 0000:00:05.0: setting latency timer to 64 > [ 69.979118] ngene: Device version 1 > [ 69.979129] ngene 0000:00:05.0: firmware: requesting ngene_18.fw > [ 69.980884] ngene: Loading firmware file ngene_18.fw. > [ 71.981052] ngene: Command timeout cmd=3D01 prev=3D00 > [ 71.981205] host_to_ngene (c000): 01 00 00 00 00 00 00 00 > [ 71.981457] ngene_to_host (c100): 00 00 00 00 00 00 00 00 > [ 71.981704] dev->hosttongene (ec902000): 01 00 00 00 00 00 00 00 > [ 71.981963] dev->ngenetohost (ec902100): 00 00 00 00 00 00 00 00 > [ 73.985111] ngene: Command timeout cmd=3D02 prev=3D00 > [ 73.985415] host_to_ngene (c000): 02 04 00 d0 00 04 00 00 > [ 73.985684] ngene_to_host (c100): 00 00 00 00 00 00 00 00 > [ 73.985931] dev->hosttongene (ec902000): 02 04 00 d0 00 04 00 00 > [ 73.986191] dev->ngenetohost (ec902100): 00 00 00 00 00 00 00 00 > [ 73.986568] ngene 0000:00:05.0: PCI INT A disabled > [ 73.986584] ngene: probe of 0000:00:05.0 failed with error -1 >=20 >=20 > Sometimes the device (on guest) gets an msi-irq f. e. IRQ 29. > Then kernel-modul (ngene) can succesfully load the driver and all works= fine. >=20 >=20 > Short to say: >=20 > HOST GUEST STATUS > MSI-IRQ MSI-IRQ ALL FINE > MSI-IRQ IOAPIC-IRQ DOESN=C2=B4t WORK >=20 > with modinfo I had a look at the kernel-modul if there is way to force > msi, but without success. >=20 > But I think IRQ between (10-16) should also work because when I load th= e kernel-modul on host with IRQ (10-16) > it works. (Device only get=C2=B4s an MSI-IRQ If I start the vm to passt= hrough) >=20 > Do anyone know where can be the problem? Does '-device pci-assign,host=3D02:00.0,prefer_msi=3Doff' help? >=20 > ** Affects: qemu > Importance: Undecided > Status: New >=20 You filed against the wrong component, device assignment is a qemu-kvm feature, not yet one of qemu. Jan --------------enigC8620B2B51AEB99FBD848549 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ iEYEARECAAYFAk3zM4cACgkQitSsb3rl5xSsNwCgk45a4+K4WqBpC4djWKUtwrZY cUwAoN9ahPL0H0dIFKMsk7LI97FfPeZC =jtw4 -----END PGP SIGNATURE----- --------------enigC8620B2B51AEB99FBD848549--