Hello All,
I am using proxmox VE in the latest Version (1.6-5261-4) and have some problems with PCI Passthrough
to a KVM-virtualised machine.
Ok just some details to the hardware:
- Motherboard: Intel DQ57TM
- Prozessor: Intel Core I5-650
- Card for Passtrough: Digital Devices Cine S2 (PCI Express 1x TV Dual-Tuner S2 Card)
Both the CPU and the board are supporting VT-D and it is enabled in bios.
These are the setps I have done:
1. Install Proxmox VE from CD
2. Install newer Kernel 2.6.35:
wget ftp://download.proxmox.com/debian/di...35-3_amd64.deb
dpkg -i pve-kernel-2.6.35-1-pve_2.6.35-3_amd64.deb
3. Enable Intels VT-d support for this kernel.
without doing that it wouldn´t work for me. I got an error message in the kernel log something like this: ".... no iommu found....device hasn´t been assigned before so can not be reassigned."
nano /boot/grub/menu.lst
...
kernel /vmlinuz-2.6.35-1-pve root=/dev/mapper/pve-root ro intel_iommu=on nousb
4. Get Card-Information with lspci
lspci
00:00.0 Host bridge: Intel Corporation Core Processor DRAM Controller (rev 02)
00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 02)
00:16.0 Communication controller: Intel Corporation 5 Series/3400 Series Chipset HECI Controller (rev 06)
00:16.2 IDE interface: Intel Corporation 5 Series/3400 Series Chipset PT IDER Controller (rev 06)
00:16.3 Serial controller: Intel Corporation 5 Series/3400 Series Chipset KT Controller (rev 06)
00:19.0 Ethernet controller: Intel Corporation 82578DM Gigabit Network Connection (rev 06)
00:1a.0 USB Controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 06)
00:1b.0 Audio device: Intel Corporation 5 Series/3400 Series Chipset High Definition Audio (rev 06)
00:1c.0 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 1 (rev 06)
00:1c.4 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 5 (rev 06)
00:1d.0 USB Controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 06)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev a6)
00:1f.0 ISA bridge: Intel Corporation 5 Series Chipset LPC Interface Controller (rev 06)
00:1f.2 IDE interface: Intel Corporation 5 Series/3400 Series Chipset 4 port SATA IDE Controller (rev 06)
00:1f.3 SMBus: Intel Corporation 5 Series/3400 Series Chipset SMBus Controller (rev 06)
00:1f.5 IDE interface: Intel Corporation 5 Series/3400 Series Chipset 2 port SATA IDE Controller (rev 06)
--> 02:00.0 Multimedia video controller: Micronas Semiconductor Holding AG Device 0720 (rev 01)
proxmox:~# lspci -vv | grep IRQ
Interrupt: pin A routed to IRQ 11
Interrupt: pin A routed to IRQ 11
Interrupt: pin C routed to IRQ 18
Interrupt: pin B routed to IRQ 17
Interrupt: pin A routed to IRQ 44
Interrupt: pin B routed to IRQ 21
Interrupt: pin C routed to IRQ 18
Interrupt: pin D routed to IRQ 19
Interrupt: pin A routed to IRQ 16
Interrupt: pin A routed to IRQ 22
Interrupt: pin B routed to IRQ 19
Interrupt: pin C routed to IRQ 16
Interrupt: pin D routed to IRQ 18
Interrupt: pin A routed to IRQ 23
Interrupt: pin A routed to IRQ 23
Interrupt: pin B routed to IRQ 45
Interrupt: pin C routed to IRQ 18
--> Interrupt: pin A routed to IRQ 11
Lspci –n
00:00.0 0600: 8086:0040 (rev 02)
00:02.0 0300: 8086:0042 (rev 02)
00:16.0 0780: 8086:3b64 (rev 06)
00:16.2 0101: 8086:3b66 (rev 06)
00:16.3 0700: 8086:3b67 (rev 06)
00:19.0 0200: 8086:10ef (rev 06)
00:1a.0 0c03: 8086:3b3c (rev 06)
00:1b.0 0403: 8086:3b56 (rev 06)
00:1c.0 0604: 8086:3b42 (rev 06)
00:1c.4 0604: 8086:3b4a (rev 06)
00:1d.0 0c03: 8086:3b34 (rev 06)
00:1e.0 0604: 8086:244e (rev a6)
00:1f.0 0601: 8086:3b0a (rev 06)
00:1f.2 0101: 8086:3b20 (rev 06)
00:1f.3 0c05: 8086:3b30 (rev 06)
00:1f.5 0101: 8086:3b26 (rev 06)
--> 02:00.0 0400: 18c3:0720 (rev 01)
-[0000:00]-+-00.0 Intel Corporation Core Processor DRAM Controller
+-02.0 Intel Corporation Core Processor Integrated Graphics Controller
+-16.0 Intel Corporation 5 Series/3400 Series Chipset HECI Controller
+-16.2 Intel Corporation 5 Series/3400 Series Chipset PT IDER Controller
+-16.3 Intel Corporation 5 Series/3400 Series Chipset KT Controller
+-19.0 Intel Corporation 82578DM Gigabit Network Connection
+-1a.0 Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller
+-1b.0 Intel Corporation 5 Series/3400 Series Chipset High Definition Audio
+-1c.0-[0000:01]--
--> +-1c.4-[0000:02]----00.0 Micronas Semiconductor Holding AG Device 0720
+-1d.0 Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller
+-1e.0-[0000:03]--
+-1f.0 Intel Corporation 5 Series Chipset LPC Interface Controller
+-1f.2 Intel Corporation 5 Series/3400 Series Chipset 6 port SATA AHCI Controller
\-1f.3 Intel Corporation 5 Series/3400 Series Chipset SMBus Controller
As you can see the card is sharing the IRQ with USB-Device
5. So I bootet the kernel with parameter "nousb"
kernel /vmlinuz-2.6.35-1-pve root=/dev/mapper/pve-root ro intel_iommu=on nousb
6. Blacklist kernel-modul
with lspci -vv I can see that the card is using the ngene kernel modul.
This modul is also in use from the modul dvb_core.
So I blacklistet this two kernel moduls:
nano /etc/modprobe.d/blacklist
blacklist ngene
blacklist dvb_core
And after reboot with lsmod I can see that these kernel modules aren´t running any more.
7. Unbind device (don´t know if this is necessary)
Now I unbind the device:
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 –a kvm kvm_intel
no I can see in kernel-log something like this ....02:00.0 claimed by pci-stub....
sound good I think
7. Passthrough the device to VM and start VM:
nano /etc/qemu-server/101.conf
...
args: -device pci-assign,host=02:00.0
8. Then Start the vm
Now the card gets on the host via MSI an IRQ higher 30.
proxmox:~# lspci -vv | grep IRQ
Interrupt: pin A routed to IRQ 11
Interrupt: pin A routed to IRQ 11
Interrupt: pin C routed to IRQ 18
Interrupt: pin B routed to IRQ 17
Interrupt: pin A routed to IRQ 44
Interrupt: pin B routed to IRQ 21
Interrupt: pin C routed to IRQ 18
Interrupt: pin D routed to IRQ 19
Interrupt: pin A routed to IRQ 16
Interrupt: pin A routed to IRQ 22
Interrupt: pin B routed to IRQ 19
Interrupt: pin C routed to IRQ 16
Interrupt: pin D routed to IRQ 18
Interrupt: pin A routed to IRQ 23
Interrupt: pin A routed to IRQ 23
Interrupt: pin B routed to IRQ 45
Interrupt: pin C routed to IRQ 18
--> Interrupt: pin A routed to IRQ 48
lspci -vv
01:00.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- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
--> Interrupt: pin A routed to IRQ 48
....
proxmox:~# cat /proc/interrupts
CPU0 CPU1 CPU2 CPU3
0: 27 0 0 0 IO-APIC-edge timer
1: 2 0 0 0 IO-APIC-edge i8042
8: 0 0 0 0 IO-APIC-edge rtc0
9: 0 0 0 0 IO-APIC-fasteoi acpi
12: 4 0 0 0 IO-APIC-edge i8042
16: 583 0 0 0 IO-APIC-fasteoi nGene
40: 1 0 0 0 DMAR_MSI-edge dmar1
41: 0 0 0 0 DMAR_MSI-edge dmar0
42: 0 0 0 0 DMAR_MSI-edge dmar2
45: 5757 0 0 0 PCI-MSI-edge eth0
46: 18083 0 0 0 PCI-MSI-edge ahci
47: 274 0 0 0 PCI-MSI-edge hda_intel
48: 304 0 0 0 PCI-MSI-edge kvm_assigned_msi_device
NMI: 0 0 0 0 Non-maskable interrupts
LOC: 227001 190904 56940 19999 Local timer interrupts
SPU: 0 0 0 0 Spurious interrupts
PMI: 0 0 0 0 Performance monitoring interrupts
PND: 0 0 0 0 Performance pending work
RES: 70125 78291 63385 59768 Rescheduling interrupts
CAL: 7533 10865 10312 5182 Function call interrupts
TLB: 317 248 38 261 TLB shootdowns
TRM: 0 0 0 0 Thermal event interrupts
THR: 0 0 0 0 Threshold APIC interrupts
MCE: 0 0 0 0 Machine check exceptions
MCP: 3 3 3 3 Machine check polls
This sound very good.
My Problem is that the card gets detected on the VM but doesn´t get any signal!!!
I have tried Windows and Linux on the vm. Both the same. Card gets detected. On Windows
I can install the drivers without any problems. But no signal
On Linux also the driver brings an error. I also get an error on the host like this:
kvm: 2444: cpu0 unhandled wrmsr: 0x198 data 0
kvm: 2444: cpu1 unhandled wrmsr: 0x198 data 0
kvm: 2444: cpu2 unhandled wrmsr: 0x198 data 0
kvm: 2444: cpu3 unhandled wrmsr: 0x198 data 0
I have installed yavdr (based on ubuntu) on the Virtual Machine. On this machine it looks like this:
@TV-SERVER:~$ lspci -vv 00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
Subsystem: Qumranet, Inc. Device 1100
Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
Subsystem: Qumranet, Inc. Device 1100
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort-
00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II] (prog-if 80 [Master])
Subsystem: Qumranet, Inc. Device 1100
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
Region 0: [virtual] Memory at 000001f0 (32-bit, non-prefetchable) [size=8]
Region 1: [virtual] Memory at 000003f0 (type 3, non-prefetchable) [size=1]
Region 2: [virtual] Memory at 00000170 (32-bit, non-prefetchable) [size=8]
Region 3: [virtual] Memory at 00000370 (type 3, non-prefetchable) [size=1]
Region 4: I/O ports at c000 [size=16]
Kernel driver in use: ata_piix
00:01.2 USB Controller: Intel Corporation 82371SB PIIX3 USB [Natoma/Triton II] (rev 01)
Subsystem: Qumranet, Inc. Device 1100
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
Interrupt: pin D routed to IRQ 11
Region 4: I/O ports at c020 [size=32]
Kernel driver in use: uhci_hcd
00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03)
Subsystem: Qumranet, Inc. Device 1100
Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
Kernel driver in use: piix4_smbus
Kernel modules: i2c-piix4
00:02.0 VGA compatible controller: Cirrus Logic GD 5446
Subsystem: Qumranet, Inc. Device 1100
Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
Region 1: Memory at f2000000 (32-bit, non-prefetchable) [size=4K]
Expansion ROM at f2010000 [disabled] [size=64K]
Kernel modules: cirrusfb
00:03.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller (rev 03)
Subsystem: Qumranet, Inc. Device 1100
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
Interrupt: pin A routed to IRQ 10
Region 0: Memory at f2020000 (32-bit, non-prefetchable) [size=128K]
Region 1: I/O ports at c040 [size=64]
Expansion ROM at f2040000 [disabled] [size=128K]
Kernel driver in use: e1000
Kernel modules: e1000
00:04.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- ParErr- Stepping- SERR- FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
Region 0: Memory at f2060000 (32-bit, non-prefetchable) [size=64K]
Region 1: Memory at f2070000 (32-bit, non-prefetchable) [size=64K]
Capabilities: access denied
Kernel modules: ngene
@TV-SERVER:~$ dmesg | grep ngene
[ 2.438162] ngene 0000:00:04.0: PCI INT A -> Link[LNKD] -> GSI 11 (level, high) -> IRQ 11
[ 2.438171] ngene: Found Linux4Media cineS2 DVB-S2 Twin Tuner (v5)
[ 2.440037] ngene 0000:00:04.0: setting latency timer to 64
[ 2.440234] ngene: Device version 1
[ 2.440250] ngene 0000:00:04.0: firmware: requesting ngene_15.fw
[ 3.240072] ngene: Loading firmware file ngene_15.fw.
[ 5.240151] ngene: Command timeout cmd=01 prev=00
[ 5.240391] host_to_ngene (c000): 01 00 00 00 00 00 00 00
[ 5.240644] ngene_to_host (c100): 00 00 00 00 00 00 00 00
[ 5.240890] dev->hosttongene (ede92000): 01 00 00 00 00 00 00 00
[ 5.241165] dev->ngenetohost (ede92100): 00 00 00 00 00 00 00 00
[ 7.260048] ngene: Command timeout cmd=02 prev=00
[ 7.260065] host_to_ngene (c000): 02 04 00 d0 00 04 00 00
[ 7.260072] ngene_to_host (c100): 00 00 00 00 00 00 00 00
[ 7.260078] dev->hosttongene (ede92000): 02 04 00 d0 00 04 00 00
[ 7.260080] dev->ngenetohost (ede92100): 00 00 00 00 00 00 00 00
[ 7.260268] ngene 0000:00:04.0: PCI INT A disabled
[ 7.260319] ngene: probe of 0000:00:04.0 failed with error -1
@TV-SERVER:~$ lspci -vv | grep IRQ
Interrupt: pin D routed to IRQ 11
Interrupt: pin A routed to IRQ 9
Interrupt: pin A routed to IRQ 10
Interrupt: pin A routed to IRQ 11
@TV-SERVER:~$ cat /proc/interrupts
0: 34 0 0 0 0 0 0 0 IO-APIC-edge timer
1: 0 2 2 2 0 1 1 1 IO-APIC-edge i8042
6: 0 1 0 0 0 0 0 1 IO-APIC-edge floppy
8: 0 0 0 0 0 0 1 0 IO-APIC-edge rtc0
9: 0 0 0 0 0 0 0 0 IO-APIC-fasteoi acpi
10: 0 272 272 273 274 272 273 272 IO-APIC-fasteoi eth0
11: 0 3 4 3 3 4 3 3 IO-APIC-fasteoi uhci_hcd:usb1
12: 0 22 22 23 23 20 22 23 IO-APIC-edge i8042
14: 3013 0 0 0 0 0 0 0 IO-APIC-edge ata_piix
15: 866 0 0 0 0 0 0 0 IO-APIC-edge ata_piix
NMI: 0 0 0 0 0 0 0 0 Non-maskable interrupts
LOC: 136940 81337 78280 78466 78710 78201 78973 78432 Local timer interrupts
SPU: 0 0 0 0 0 0 0 0 Spurious interrupts
PMI: 0 0 0 0 0 0 0 0 Performance monitoring interrupts
PND: 0 0 0 0 0 0 0 0 Performance pending work
RES: 2908 2327 1680 1800 1054 1437 712 632 Rescheduling interrupts
CAL: 52 80 79 76 74 62 69 68 Function call interrupts
TLB: 134 195 124 190 131 135 129 85 TLB shootdowns
TRM: 0 0 0 0 0 0 0 0 Thermal event interrupts
THR: 0 0 0 0 0 0 0 0 Threshold APIC interrupts
MCE: 0 0 0 0 0 0 0 0 Machine check exceptions
MCP: 2 2 2 2 2 2 2 2 Machine check polls
ERR: 0
MIS: 0
@TV-SERVER:~$ lspci -vt
-[0000:00]-+-00.0 Intel Corporation 440FX - 82441FX PMC [Natoma]
+-01.0 Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
+-01.1 Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
+-01.2 Intel Corporation 82371SB PIIX3 USB [Natoma/Triton II]
+-01.3 Intel Corporation 82371AB/EB/MB PIIX4 ACPI
+-02.0 Cirrus Logic GD 5446
+-03.0 Intel Corporation 82540EM Gigabit Ethernet Controller
\-04.0 Micronas Semiconductor Holding AG Device 0720
Does anyone of you have an idea how to get the passthrough really working??!!
I know its a bit of a late answer, but I guess more people will be looking for an answer.
A lot of device do not work well with MSI/MSIx translation of IRQs and so does the Cine S2.
The reason that you can not tune after installing the driver is that only the bridge itself is detected ( ngene base device ) and not the tuners, cam etc. You can check this in the Device Manager in Windows.
The only way ( for as far as I can tell there are no parameters to do that ) to disable MSI/MSIx translations in KVM is to recompile the module and modify the assigned-dev.c file.
The latest module source can be downloaded from http://sourceforge.net/projects/kvm/files/
Extract the downloaded package and enter the folder
Run ./configure ( make sure you will have the kernel-devel package else it will fail )
Edit the file x86/assigned-dev.c
in the function static int assign_host_irq comment out the switch statement and add the assigned_device_enable_host_intx above it
Something like this (depending on kvm source version):
printk(KERN_WARNING "host_irq - always use intx\n");
r = assigned_device_enable_host_intx(kvm, dev);
/*
switch (host_irq_type) {
case KVM_DEV_IRQ_HOST_INTX:
printk(KERN_WARNING "host_intx\n");
r = assigned_device_enable_host_intx(kvm, dev);
break;
#ifdef __KVM_HAVE_MSI
case KVM_DEV_IRQ_HOST_MSI:
printk(KERN_WARNING "host_msi\n");
r = assigned_device_enable_host_msi(kvm, dev);
break;
#endif
#ifdef __KVM_HAVE_MSIX
case KVM_DEV_IRQ_HOST_MSIX:
printk(KERN_WARNING "host_msix\n");
r = assigned_device_enable_host_msix(kvm, dev);
break;
#endif
default:
r = -EINVAL;
}
*/
And in the static int assign_guest_irq also comment out the switch statement and add the assigned_device_enable_guest_intx above it
printk(KERN_WARNING "guest_irq - always use intx\n");
r = assigned_device_enable_guest_intx(kvm, dev, irq);
/*
switch (guest_irq_type) {
case KVM_DEV_IRQ_GUEST_INTX:
printk(KERN_WARNING "guest_intx\n");
r = assigned_device_enable_guest_intx(kvm, dev, irq);
break;
#ifdef __KVM_HAVE_MSI
case KVM_DEV_IRQ_GUEST_MSI:
r = assigned_device_enable_guest_msi(kvm, dev, irq);
break;
#endif
#ifdef __KVM_HAVE_MSIX
case KVM_DEV_IRQ_GUEST_MSIX:
r = assigned_device_enable_guest_msix(kvm, dev, irq);
break;
#endif
default:
r = -EINVAL;
}
*/
Save the file
Now run make and make install and afterwards reboot
If all went well KVM will now no longer try to translate the IRQ to MSI/MSIx.
If you are using a Windows guest it should now show all the subdevices in the Device Manager ( Tuner etc ) instead of just the base device ( ngene bridge )
Regards,
Rob
Hi
I have a Digital Devices Octopus DVB-C card. I try to run it unter a kvm on an intel DQ45CB/Core2Quad system. On the host system the card runs fine and stable. Under the guest system I get a good reception for a few minutes, then the picture freezes and the dd_core driver on the guest says I2C timeout. If I reboot the VM, the card will work again for a while only to crash a few minutes later. I've tried Ubuntu and Debian guest kernels, always using the latest drivers. I tried hpet, acpi_pm and kvm-clock clocksources. No difference, only that when using hpet clocksource, I get additional messages in the error log about QAM64.
Any knowledge about such behavior?
Greetings
Johannes
Post new comment