kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* PCI passthrough
@ 2009-09-24  0:01 Matt Piermarini
  2009-09-24 11:46 ` Avi Kivity
  0 siblings, 1 reply; 5+ messages in thread
From: Matt Piermarini @ 2009-09-24  0:01 UTC (permalink / raw)
  To: kvm

Hi all -

I'm trying to PCI passthrough a Digium TDM card (Tiger Jet Network Inc. 
Tiger3XX Modem/ISDN interface) used for a PBX (asterisk).  I'm not 
having any luck and thought I'd post here to see if this is even capable 
of working.   I'm using a host kernel 2.6.30.6-53 (built from a F11 
source rpm).   I've compiled qemu-kvm 10.6, libvirt 0.7.1-1, and tried 
kvm in the 2.6.30.6-53 kernel and kvm-kmod-2.6.30.1.    When starting 
the VM,  pci-stub binds to the card, and the guest can "see" the card 
(lspci -v).   But when the zaptel/dahdi drivers try to init (in the 
guest), I get this:

#modprobe wctdm
Sep 23 19:47:45 test kernel: dahdi: Telephony Interface Registered on 
major 196
Sep 23 19:47:45 test kernel: dahdi: Version: 2.2.0.2
Sep 23 19:47:45 test kernel: wctdm 0000:00:07.0: PCI INT A -> Link[LNKC] 
-> GSI 10 (level, high) -> IRQ 10
Sep 23 19:47:46 test kernel: TDM PCI Master abort
Sep 23 19:47:46 test kernel: Freshmaker version: ff
Sep 23 19:47:46 test kernel: 00 != ff
Sep 23 19:47:46 test kernel: 01 != ff
Sep 23 19:47:46 test kernel: 02 != ff
...lots of these...
Sep 23 19:47:46 test kernel: fd != ff
Sep 23 19:47:46 test kernel: fe != ff
Sep 23 19:47:46 test kernel: Freshmaker failed register test
Sep 23 19:47:46 test kernel: TDM PCI Master abort
Sep 23 19:47:47 test kernel: wctdm: probe of 0000:00:07.0 failed with 
error -5

For guests, I've tried both Centos 5.3 and Fedora 11.  Both behave 
exactly the same (and both are using virtio_net/pci).

Something I've also noticed is that once pci-stub binds and then unbinds 
to the card, the HOST behaves exactly the same (same exact errors when 
modprobe wctdm).  The only way I can get the HOST drivers to work (after 
unbind pci-stub) is to remove the pci card from the bus, then rescan the 
bus to bring it back.  This allows the HOST drivers to work, but this 
trick does not work in the guest.

echo "1" > /sys/bus/pci/devices/0000\:03\:00.0/remove
echo "1" > /sys/bus/pci/rescan

If anybody has any ideas I can try, I'd surely appreciate it.  My host 
does NOT have vt-d capable hardware, and I'm not even sure that is 
requirement - is it?  Host is an Intel ICH10/P45/Q6600.

Thanks - Matt

----------------
lspci -v for the HOST
03:00.0 Communication controller: Tiger Jet Network Inc. Tiger3XX 
Modem/ISDN interface
     Subsystem: Device b119:0003
     Flags: bus master, medium devsel, latency 64, IRQ 20
     I/O ports at d000 [size=256]
     [virtual] Memory at f4000000 (32-bit, non-prefetchable) [size=4K]
     Capabilities: [40] Power Management version 2
     Kernel driver in use: pci-stub
     Kernel modules: hisax, wctdm

lspci -v the the GUEST:

00:07.0 Communication controller: Tiger Jet Network Inc. Tiger3XX 
Modem/ISDN interface
     Subsystem: Device b119:0003
     Physical Slot: 7
     Flags: bus master, medium devsel, latency 64, IRQ 10
     I/O ports at c300 [size=256]
     Memory at f2001000 (32-bit, non-prefetchable) [size=4K]
     Kernel modules: wctdm, hisax






^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PCI passthrough
  2009-09-24  0:01 PCI passthrough Matt Piermarini
@ 2009-09-24 11:46 ` Avi Kivity
  2009-09-24 14:03   ` Matt Piermarini
  0 siblings, 1 reply; 5+ messages in thread
From: Avi Kivity @ 2009-09-24 11:46 UTC (permalink / raw)
  To: Matt Piermarini; +Cc: kvm

On 09/24/2009 03:01 AM, Matt Piermarini wrote:
>
> If anybody has any ideas I can try, I'd surely appreciate it.  My host 
> does NOT have vt-d capable hardware, and I'm not even sure that is 
> requirement - is it?  Host is an Intel ICH10/P45/Q6600.
>
>     Flags: bus master, medium devsel, latency 64, IRQ 20

"bus master" means the card can dma, which requires an iommu.

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PCI passthrough
  2009-09-24 11:46 ` Avi Kivity
@ 2009-09-24 14:03   ` Matt Piermarini
  0 siblings, 0 replies; 5+ messages in thread
From: Matt Piermarini @ 2009-09-24 14:03 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm

On 09/24/2009 07:46 AM, Avi Kivity wrote:
> On 09/24/2009 03:01 AM, Matt Piermarini wrote:
>>
>> If anybody has any ideas I can try, I'd surely appreciate it.  My 
>> host does NOT have vt-d capable hardware, and I'm not even sure that 
>> is requirement - is it?  Host is an Intel ICH10/P45/Q6600.
>>
>>     Flags: bus master, medium devsel, latency 64, IRQ 20
>
> "bus master" means the card can dma, which requires an iommu.
>
Thanks for the info -- At least I know I can stop pulling my hair out now.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* PCI passthrough
@ 2015-03-16 13:35 shacky
  2015-03-16 19:56 ` Alex Williamson
  0 siblings, 1 reply; 5+ messages in thread
From: shacky @ 2015-03-16 13:35 UTC (permalink / raw)
  To: kvm

Hi.
I'm using Proxmox VE 3.4 with qemu-server 3.3, and I'm trying to pass
two PCI-Express AudioScience soundcards to a KVM virtual machine.

The soundcards are the following:

ve2:/# lspci
03:00.0 PCI bridge: Texas Instruments XIO2000(A)/XIO2200A PCI
Express-to-PCI Bridge (rev 03)
04:00.0 Multimedia audio controller: Texas Instruments TMS320C6414
TMS320C6415 TMS320C6416
05:00.0 PCI bridge: Texas Instruments XIO2000(A)/XIO2200A PCI
Express-to-PCI Bridge (rev 03)
06:00.0 Multimedia audio controller: Texas Instruments TMS320C6414
TMS320C6415 TMS320C6416

and I configured the virtual machine in this way:

machine: q35
hostpci0: 03:00.0
hostpci1: 04:00.0
hostpci2: 05:00.0
hostpci3: 06:00.0

But when I try to start the virtual machine I get the following error:

ve2:/# qm start 202
kvm: -device pci-assign,host=03:00.0,id=hostpci0,bus=pci.0,addr=0x10:
Device assignment only supports endpoint assignment, device type 7
kvm: -device pci-assign,host=03:00.0,id=hostpci0,bus=pci.0,addr=0x10:
Device initialization failed.
kvm: -device pci-assign,host=03:00.0,id=hostpci0,bus=pci.0,addr=0x10:
Device 'kvm-pci-assign' could not be initialized

I realized that I cannot pass the PCI bridge, so the VM starts passing
only 04:00.0 and 06:00.0 devices.

But Alsa on the virtual machine cannot recognise the soundcards, so
I'm thinking that the problem could be that I'm not passing the PCI
bridge.

Could you help me please?

Thank you very much!
Bye

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PCI passthrough
  2015-03-16 13:35 shacky
@ 2015-03-16 19:56 ` Alex Williamson
  0 siblings, 0 replies; 5+ messages in thread
From: Alex Williamson @ 2015-03-16 19:56 UTC (permalink / raw)
  To: shacky; +Cc: kvm

On Mon, 2015-03-16 at 14:35 +0100, shacky wrote:
> Hi.
> I'm using Proxmox VE 3.4 with qemu-server 3.3, and I'm trying to pass
> two PCI-Express AudioScience soundcards to a KVM virtual machine.
> 
> The soundcards are the following:
> 
> ve2:/# lspci
> 03:00.0 PCI bridge: Texas Instruments XIO2000(A)/XIO2200A PCI
> Express-to-PCI Bridge (rev 03)
> 04:00.0 Multimedia audio controller: Texas Instruments TMS320C6414
> TMS320C6415 TMS320C6416
> 05:00.0 PCI bridge: Texas Instruments XIO2000(A)/XIO2200A PCI
> Express-to-PCI Bridge (rev 03)
> 06:00.0 Multimedia audio controller: Texas Instruments TMS320C6414
> TMS320C6415 TMS320C6416
> 
> and I configured the virtual machine in this way:
> 
> machine: q35
> hostpci0: 03:00.0
> hostpci1: 04:00.0
> hostpci2: 05:00.0
> hostpci3: 06:00.0
> 
> But when I try to start the virtual machine I get the following error:
> 
> ve2:/# qm start 202
> kvm: -device pci-assign,host=03:00.0,id=hostpci0,bus=pci.0,addr=0x10:
> Device assignment only supports endpoint assignment, device type 7
> kvm: -device pci-assign,host=03:00.0,id=hostpci0,bus=pci.0,addr=0x10:
> Device initialization failed.
> kvm: -device pci-assign,host=03:00.0,id=hostpci0,bus=pci.0,addr=0x10:
> Device 'kvm-pci-assign' could not be initialized
> 
> I realized that I cannot pass the PCI bridge, so the VM starts passing
> only 04:00.0 and 06:00.0 devices.
> 
> But Alsa on the virtual machine cannot recognise the soundcards, so
> I'm thinking that the problem could be that I'm not passing the PCI
> bridge.

It's never correct to pass the bridge.  Do you get any errors in the
guest when the driver for the sound card is loaded?  Does it work with
440fx machine type (why are you using q35)?  What's the underlying qemu
and kernel version?  Have you tried vfio-pci instead of legacy device
assignment?  Thanks,

Alex


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-03-16 19:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-24  0:01 PCI passthrough Matt Piermarini
2009-09-24 11:46 ` Avi Kivity
2009-09-24 14:03   ` Matt Piermarini
  -- strict thread matches above, loose matches on Subject: below --
2015-03-16 13:35 shacky
2015-03-16 19:56 ` Alex Williamson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).