LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-24-2009, 10:53 AM   #1
vegatux
LQ Newbie
 
Registered: Sep 2009
Location: Germany
Distribution: Debian Squeeze and Sid
Posts: 1

Rep: Reputation: 0
problem with kvm and pci passthrough with two devices


Hi.
My Problem is that i want to pass two devices, in my case two identical tv-cards, to my VM. When i have only one card installed it works fine, and i see the device in the VM.

I use Debian Lenny with additional packages from Debian Sid for the KVM packages. The Kernel is a vanilla kernel with modifications, like explained on http://www.linux-kvm.org/page/How_to_assign...

My Kernel is a 2.6.31 and the kvm version is 85.
My hardware is an AMD X2 4850e on a Gigabyte mainboard (GA-M61P-S3) with a GeForce 6100 / nForce 430 chipset.


I followed all further steps from that page.

Find my tv-cards:
Code:
debian-server:~# lspci | grep SkyStar
01:07.0 Network controller: Techsan Electronics Co Ltd B2C2 FlexCopII DVB chip / Technisat SkyStar2 DVB card (rev 02)
01:09.0 Network controller: Techsan Electronics Co Ltd B2C2 FlexCopII DVB chip / Technisat SkyStar2 DVB card (rev 02)

Check their IRQ's:
Code:
01:07.0 Network controller: Techsan Electronics Co Ltd B2C2 FlexCopII DVB chip / Technisat SkyStar2 DVB card (rev 02)
	Subsystem: Techsan Electronics Co Ltd B2C2 FlexCopII DVB chip / Technisat SkyStar2 DVB card
	Flags: bus master, slow devsel, latency 32, IRQ 5
	Memory at ed400000 (32-bit, non-prefetchable) [size=64K]
	I/O ports at d000 [size=32]

01:09.0 Network controller: Techsan Electronics Co Ltd B2C2 FlexCopII DVB chip / Technisat SkyStar2 DVB card (rev 02)
	Subsystem: Techsan Electronics Co Ltd B2C2 FlexCopII DVB chip / Technisat SkyStar2 DVB card
	Flags: bus master, slow devsel, latency 32, IRQ 7
	Memory at ed410000 (32-bit, non-prefetchable) [size=64K]
	I/O ports at d400 [size=32]

Check for other devices with identical IRQ:
Code:
debian-server:/var/log# lspci -v | grep IRQ
	Flags: 66MHz, fast devsel, IRQ 7
	Flags: bus master, 66MHz, fast devsel, latency 0, IRQ 23
	Flags: bus master, 66MHz, fast devsel, latency 0, IRQ 22
	Flags: bus master, 66MHz, fast devsel, latency 0, IRQ 25
	Flags: bus master, 66MHz, fast devsel, latency 0, IRQ 11
	Flags: bus master, slow devsel, latency 32, IRQ 5
	Flags: bus master, slow devsel, latency 32, IRQ 7
	Flags: bus master, stepping, 66MHz, medium devsel, latency 32, IRQ 16

Create new stud-device, unbind cards, bind them to stud-driver. I tried two ways:
Code:
debian-server:~# echo "13d0 2103" > /sys/bus/pci/drivers/pci-stub/new_id 
debian-server:~# echo "13d0 2103" > /sys/bus/pci/drivers/pci-stub/new_id 
debian-server:~# echo 0000:01:07.0 > /sys/bus/pci/devices/0000\:01\:07.0/driver/unbind 
debian-server:~# echo 0000:01:07.0 > /sys/bus/pci/drivers/pci-stub/bind
debian-server:~# echo 0000:01:09.0 > /sys/bus/pci/devices/0000\:01\:09.0/driver/unbind 
debian-server:~# echo 0000:01:09.0 > /sys/bus/pci/drivers/pci-stub/bind
and with append
Code:
debian-server:~# echo "13d0 2103" > /sys/bus/pci/drivers/pci-stub/new_id 
debian-server:~# echo "13d0 2103" >> /sys/bus/pci/drivers/pci-stub/new_id 
debian-server:~# echo 0000:01:07.0 > /sys/bus/pci/devices/0000\:01\:07.0/driver/unbind 
debian-server:~# echo 0000:01:07.0 > /sys/bus/pci/drivers/pci-stub/bind
debian-server:~# echo 0000:01:09.0 > /sys/bus/pci/devices/0000\:01\:09.0/driver/unbind 
debian-server:~# echo 0000:01:09.0 >> /sys/bus/pci/drivers/pci-stub/bind
Then i added the card in the VM xml file under /etc/libvirt/qemu/Debian.xml (it's nearly at the end):
Code:
<domain type='kvm'>
  <name>Debian</name>
  <uuid>fef2e6a0-3fb8-d976-c59a-53a4636d712f</uuid>
  <memory>786432</memory>
  <currentMemory>786432</currentMemory>
  <vcpu>2</vcpu>
  <os>
    <type arch='x86_64' machine='pc'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/bin/kvm</emulator>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type=''/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
    </disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/root/KVM-Images/Debian.qcow2'/>
      <target dev='vda' bus='virtio'/>
    </disk>
    <interface type='bridge'>
      <mac address='52:54:00:57:94:c0'/>
      <source bridge='br0'/>
      <model type='virtio'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/2'/>
      <target port='0'/>
    </serial>
    <console type='pty' tty='/dev/pts/2'>
      <source path='/dev/pts/2'/>
      <target port='0'/>
    </console>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <source>
      <address domain='0x0000' bus='0x01' slot='0x07' function='0x0'/>
      </source>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <source>
      <address domain='0x0000' bus='0x01' slot='0x09' function='0x0'/>
      </source>
    </hostdev>
    <input type='tablet' bus='usb'/>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='5910' autoport='no' keymap='en-us'/>
  </devices>
</domain>

When i now try to start my VM with the virt-manager, it stops with an error. An excerpt from /var/log/messages:
Code:
debian-server libvirtd: 18:58:23.326: warning : pciTrySecondaryBusReset:483 : Other devices on bus with 0000:01:07.0, not doing bus reset
The error occurs when i have a second tv-card installed. I can't find any informations about limitations with more than one device on the bus address. As you can see, my tv-cards are on bus number 1 and all onboard components number 0. Is that maybe the problem, that i block the whole bus?

I'm grateful for any ideas or helpful tips.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
KVM passing pci-e nic through zhjim Linux - General 0 06-29-2009 03:23 PM
Unable to allocate PCI Ethernet controller. Too many PCI devices already configured. tirtildim Linux - Software 2 04-17-2008 07:18 AM
Problem with DVB-T passthrough audio Jykke Linux - Hardware 1 08-15-2007 04:08 AM
Two Sound Devices: PCI and USB. Configuration problem. chakatz Linux - Hardware 0 03-05-2007 08:17 AM
Audio -Digital passthrough problem: emu10k1 Shougouki Fedora 0 05-28-2004 06:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration