Proxmox 1.1 / KVM-83 and PCI Passthrough

can i with the upcoming kernel mix the kernel-version in a cluster?
Or need i two cluster, if i want also use a machine with openvz?

It should be possible to mix kernel versions, but live migration will not work.
 
Hi,

i have sort of the same problem. I installed Proxmox VE and at the moment im running kernel 2.6.32-1-pve. Everything so far works great but i really would like to passthrough an pci device to my windows quest. The only thing i found is the QEMU Monitor but there I have only hotplugging which I cant use on windows. Anything I can enter in the /etc/qemu-server/XXX.conf file?

Regards, dacula
 
I've got new kernel and passtrough works great.

To do that you shoud modify your config file and add line:

Code:
args:  -pcidevice host=00:00.0

Where 00:00.0 is address of your device. You can get it for example from lspci.
And one thing: remember to unload pci driver/module from host proxmox system before starting guest.
 
where do i find that config file?

can you tell me how you did it? I used the parts from KVM

echo "1131 7146" > /sys/bus/pci/drivers/pci-stub/new_id
echo 0000:05:02.0 > /sys/bus/pci/devices/0000:05:02.0/driver/unbind
echo 0000:05:02.0 > /sys/bus/pci/drivers/pci-stub/bind

this in my case to unbind the device and i added your info in the config file but the pci device doesnt show up.
the one thing im confused about aswell is, when i used virtualbox e.g. i saw for the cpu my actual cpu in the system but only with one core. here i see qemu cpu.
 
Last edited:
Add the args line to /etc/qemu-server/<vid>.conf
To change cpu type add to args parameter
Code:
-cpu <type>
I suggest using type "host".

So to add all things you shoud put this line in config:
Code:
args: -pcidevice host=05:02.0 -cpu host

Also I think you just have to unload the driver module from kernel, not unbind device.
 
Hallo

I want forwarding a SATA-Controller to an WindowsXP-KVM.
No kernelmodul loaded for the controller.
I get the error:

Code:
vmbr0: port 7(vmtab101i0) entering forwarding state
sata_sil 0000:09:0d.0: BAR 5: can't reserve mem region [0xb8d10000-0xb8d101ff]
kvm_vm_ioctl_assign_device: Could not get access to device regions
kvm_vm_ioctl_deassign_device: device hasn't been assigned before, so cannot be deassigned
vmbr0: port 7(vmtab101i0) entering disabled state
vmbr0: port 7(vmtab101i0) entering disabled state
Any ideas what's wrong.

Frank

pveversion:
Code:
pve-manager: 1.5-1 (pve-manager/1.5/4561)
running kernel: 2.6.32-1-pve
proxmox-ve-2.6.32: 1.5-2
pve-kernel-2.6.32-1-pve: 2.6.32-2
pve-kernel-2.6.24-9-pve: 2.6.24-18
pve-kernel-2.6.24-8-pve: 2.6.24-16
qemu-server: 1.1-10
pve-firmware: 1.0-3
libpve-storage-perl: 1.0-6
vncterm: 0.9-2
vzctl: 3.0.23-1pve3
vzdump: 1.2-5
vzprocps: 2.0.11-1dso2
vzquota: 3.0.11-1
pve-qemu-kvm: 0.11.1-1
ksm-control-daemon: 1.0-1
lspci:
Code:
00:00.0 Host bridge: Intel Corporation 5000V Chipset Memory Controller Hub (rev b1)
00:02.0 PCI bridge: Intel Corporation 5000 Series Chipset PCI Express x8 Port 2-3 (rev b1)
00:03.0 PCI bridge: Intel Corporation 5000 Series Chipset PCI Express x4 Port 3 (rev b1)
00:08.0 System peripheral: Intel Corporation 5000 Series Chipset DMA Engine (rev b1)
00:10.0 Host bridge: Intel Corporation 5000 Series Chipset FSB Registers (rev b1)
00:10.1 Host bridge: Intel Corporation 5000 Series Chipset FSB Registers (rev b1)
00:10.2 Host bridge: Intel Corporation 5000 Series Chipset FSB Registers (rev b1)
00:11.0 Host bridge: Intel Corporation 5000 Series Chipset Reserved Registers (rev b1)
00:13.0 Host bridge: Intel Corporation 5000 Series Chipset Reserved Registers (rev b1)
00:15.0 Host bridge: Intel Corporation 5000 Series Chipset FBD Registers (rev b1)
00:16.0 Host bridge: Intel Corporation 5000 Series Chipset FBD Registers (rev b1)
00:1c.0 PCI bridge: Intel Corporation 631xESB/632xESB/3100 Chipset PCI Express Root Port 1 (rev 09)
00:1d.0 USB Controller: Intel Corporation 631xESB/632xESB/3100 Chipset UHCI USB Controller #1 (rev 09)
00:1d.1 USB Controller: Intel Corporation 631xESB/632xESB/3100 Chipset UHCI USB Controller #2 (rev 09)
00:1d.2 USB Controller: Intel Corporation 631xESB/632xESB/3100 Chipset UHCI USB Controller #3 (rev 09)
00:1d.3 USB Controller: Intel Corporation 631xESB/632xESB/3100 Chipset UHCI USB Controller #4 (rev 09)
00:1d.7 USB Controller: Intel Corporation 631xESB/632xESB/3100 Chipset EHCI USB2 Controller (rev 09)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev d9)
00:1f.0 ISA bridge: Intel Corporation 631xESB/632xESB/3100 Chipset LPC Interface Controller (rev 09)
00:1f.3 SMBus: Intel Corporation 631xESB/632xESB/3100 Chipset SMBus Controller (rev 09)
01:00.0 PCI bridge: Intel Corporation 6311ESB/6321ESB PCI Express Upstream Port (rev 01)
01:00.3 PCI bridge: Intel Corporation 6311ESB/6321ESB PCI Express to PCI-X Bridge (rev 01)
02:00.0 PCI bridge: Intel Corporation 6311ESB/6321ESB PCI Express Downstream Port E1 (rev 01)
02:01.0 PCI bridge: Intel Corporation 6311ESB/6321ESB PCI Express Downstream Port E2 (rev 01)
02:02.0 PCI bridge: Intel Corporation 6311ESB/6321ESB PCI Express Downstream Port E3 (rev 01)
03:00.0 RAID bus controller: Adaptec AAC-RAID (rev 09)
05:00.0 Ethernet controller: Intel Corporation 80003ES2LAN Gigabit Ethernet Controller (Copper) (rev 01)
05:00.1 Ethernet controller: Intel Corporation 80003ES2LAN Gigabit Ethernet Controller (Copper) (rev 01)
06:02.0 Communication controller: NetMos Technology PCI 9835 Multi-I/O Controller (rev 01)
09:0c.0 VGA compatible controller: ATI Technologies Inc ES1000 (rev 02)
09:0d.0 RAID bus controller: Silicon Image, Inc. SiI 3512 [SATALink/SATARaid] Serial ATA Controller (rev 01)
config
Code:
name: V-Steuerrechner
ostype: wxp

ide0: local:101/vm-101-disk-1.raw
ide1: local:101/vm-101-disk-2.raw
#ide2: /dev/disk/by-label/Sicherung

bootdisk: ide0

sockets: 1
cores: 2

memory: 2048

onboot: 1
boot: ca
freeze: 0
cpuunits: 1000
acpi: 1
kvm: 1

vlan0: e1000=C2:2C:F9:1E:1C:0C

hostusb: 0529:0001
parallel: /dev/parport0

args: -pcidevice host=09:0d.0
 
lsmod befor plug in the controller
Code:
tun                    13626  10
kvm_intel              44580  15
kvm                   272728  1 kvm_intel
ib_iser                30158  0
rdma_cm                28627  1 ib_iser
ib_cm                  36081  1 rdma_cm
iw_cm                   8828  1 rdma_cm
ib_sa                  21435  2 rdma_cm,ib_cm
ib_mad                 39849  2 ib_cm,ib_sa
ib_core                62732  6 ib_iser,rdma_cm,ib_cm,iw_cm,ib_sa,ib_mad
ib_addr                 6560  1 rdma_cm
iscsi_tcp               9906  0
libiscsi_tcp           16452  1 iscsi_tcp
libiscsi               43188  3 ib_iser,iscsi_tcp,libiscsi_tcp
scsi_transport_iscsi    37072  4 ib_iser,iscsi_tcp,libiscsi
nls_iso8859_1           4585  1
cifs                  256756  2
bridge                 50788  0
stp                     2091  1 bridge
ppdev                   6026  0
parport_serial          4999  0
parport_pc             30008  1 parport_serial
snd_pcm                84498  0
parport                38550  2 ppdev,parport_pc
snd_timer              22074  1 snd_pcm
snd                    68642  2 snd_pcm,snd_timer
soundcore               7828  1 snd
snd_page_alloc          8388  1 snd_pcm
ioatdma                41167  24
i5k_amb                 4991  0
serio_raw               4704  0
i5000_edac              8544  0
i2c_i801                8839  0
psmouse                60977  0
dca                     6349  1 ioatdma
edac_core              43192  3 i5000_edac
pcspkr                  1982  0
shpchp                 32536  0
aacraid                73909  5
e1000e                133150  0

and after
Code:
tun                    13626  10
kvm_intel              44580  15
kvm                   272728  1 kvm_intel
ib_iser                30158  0
rdma_cm                28627  1 ib_iser
ib_cm                  36081  1 rdma_cm
iw_cm                   8828  1 rdma_cm
ib_sa                  21435  2 rdma_cm,ib_cm
ib_mad                 39849  2 ib_cm,ib_sa
ib_core                62732  6 ib_iser,rdma_cm,ib_cm,iw_cm,ib_sa,ib_mad
ib_addr                 6560  1 rdma_cm
iscsi_tcp               9906  0
libiscsi_tcp           16452  1 iscsi_tcp
libiscsi               43188  3 ib_iser,iscsi_tcp,libiscsi_tcp
scsi_transport_iscsi    37072  4 ib_iser,iscsi_tcp,libiscsi
nls_iso8859_1           4585  1
cifs                  256756  2
bridge                 50788  0
stp                     2091  1 bridge
ppdev                   6026  0
snd_pcm                84498  0
parport_serial          4999  0
snd_timer              22074  1 snd_pcm
serio_raw               4704  0
parport_pc             30008  1 parport_serial
i5k_amb                 4991  0
snd                    68642  2 snd_pcm,snd_timer
soundcore               7828  1 snd
parport                38550  2 ppdev,parport_pc
ioatdma                41167  24
i5000_edac              8544  0
psmouse                60977  0
i2c_i801                8839  0
pcspkr                  1982  0
snd_page_alloc          8388  1 snd_pcm
dca                     6349  1 ioatdma
edac_core              43192  3 i5000_edac
shpchp                 32536  0
e1000e                133150  0
aacraid                73909  5

no new modul loadet.
 
i found a howto and do this:

Code:
server:~# echo "1095 3512" > /sys/bus/pci/drivers/pcieport/new_id
server:~# echo 0000:09:0d.0 > /sys/bus/pci/devices/0000:09:0d.0/driver/unbind
server:~# echo 0000:09:0d.0 > /sys/bus/pci/drivers/pcieport/bind
-bash: echo: write error: No such device

The KVM dont start and i get

Code:
pci 0000:09:0d.0: restoring config space at offset 0x1 (was 0x2b00400, writing 0x2b00147)
pci 0000:09:0d.0: restoring config space at offset 0x1 (was 0x2b00400, writing 0x2b00147)
vmbr0: port 7(vmtab101i0) entering disabled state
vmbr0: port 7(vmtab101i0) entering disabled state
 
i tried the passtrough and it works for 2 skystar 2 DVB cards here on asrock ASRock K10N78 with Geforce 8200 Chipset, Proxmox 1.5 @ 2.6.32.

The options in /etc/qemu-server/1.conf as usual, but add "args: -pcidevice host=01:00.0" <- take this from lspci or lspci -n.

Important: You have to unload the modules you want to passtrough, "modprobe -r modulename" works.
 
i tried the passtrough and it works for 2 skystar 2 DVB cards here on asrock ASRock K10N78 with Geforce 8200 Chipset, Proxmox 1.5 @ 2.6.32.

The options in /etc/qemu-server/1.conf as usual, but add "args: -pcidevice host=01:00.0" <- take this from lspci or lspci -n.

Please can you test if it also works when you use the ' hostpci' option (see 'man qm') (instead of 'args: -pcidevice'). This should automatically unbind the device.
 
Hi.

"hostpci" does not work, VM starts as usual, but no forwarded devices.

Is syntax right:
Code:
name: vdr
ide2: local:iso/ctvdrplus70.iso,media=cdrom
vlan0: virtio=A6:1E:9C:E5:46:72
bootdisk: ide0
ostype: l26
ide0: local:1/vm-1-disk-1.raw
memory: 512
onboot: 1
sockets: 1
#args: -pcidevice host=01:09.0 #-pcidevice host=01:09.0
hostpci 01:07.0

+ there is nothing in the logs, can i start a debug mode or so?
 
Last edited:
syntax is wrong, try:

Code:
hostpci: 01:07.0

and always stop and start the VM, restart does never work.
 
ah im dumb :D
I think the option does not work:

hostpci: 01:07.0
hostpci: 01:09.0
Code:
Mar 15 20:08:18 server qm[2633]: VM 1 start
Mar 15 20:08:18 server pvedaemon[2632]: VM 1 start failed -
that's all..

if i remove the terratec card from the qemu config file:
hostpci: 01:07.0
Code:
Mar 15 20:09:16 server pvedaemon[2644]: starting VM 1 on node 0 (localhost)
Mar 15 20:09:16 server qm[2645]: VM 1 start
Mar 15 20:09:16 server kernel: pci-stub 0000:01:07.0: claimed by stub
Mar 15 20:09:16 server kernel: pci-stub 0000:01:07.0: claimed by stub
Mar 15 20:09:16 server pvedaemon[2644]: VM 1 start failed -
so it seems as if the option does not work? Do i have to unload something here?

But even with skystar 2 (using the args: option) i can't get any tv channels. Scan does not find anything, the card simply does not get signal, though it is detected correctly:

it only works with my skystar 2 dvb card, terratec cinergy dvb-s does not work:

using the args: option with both cards:
Code:
Mar 15 20:12:21 server pvedaemon[2740]: starting VM 1 on node 0 (localhost)
Mar 15 20:12:22 server qm[2741]: VM 1 start
Mar 15 20:12:22 server kernel: device vmtab1i0 entered promiscuous mode
Mar 15 20:12:22 server kernel: vmbr0: port 2(vmtab1i0) entering forwarding state
Mar 15 20:12:22 server kernel: pci-stub 0000:01:09.0: PCI INT A -> Link[LNKB] -> GSI 19 (level, low) -> IRQ 19
Mar 15 20:12:22 server kernel: pci-stub 0000:01:07.0: PCI INT A -> Link[LNKD] -> GSI 18 (level, low) -> IRQ 18
Mar 15 20:12:22 server pvedaemon[2740]: VM 1 started
Mar 15 20:12:22 server kernel: vmbr0: port 2(vmtab1i0) entering disabled state
Mar 15 20:12:22 server kernel: vmbr0: port 2(vmtab1i0) entering disabled state
Mar 15 20:12:22 server kernel: pci-stub 0000:01:07.0: PCI INT A disabled
Mar 15 20:12:22 server kernel: pci-stub 0000:01:09.0: PCI INT A disabled
Only with skystar:
Code:
Mar 15 20:16:38 server pvedaemon[2795]: starting VM 1 on node 0 (localhost)
Mar 15 20:16:38 server qm[2796]: VM 1 start
Mar 15 20:16:38 server kernel: device vmtab1i0 entered promiscuous mode
Mar 15 20:16:38 server kernel: vmbr0: port 2(vmtab1i0) entering forwarding state
Mar 15 20:16:38 server kernel: pci-stub 0000:01:07.0: PCI INT A -> Link[LNKD] -> GSI 18 (level, low) -> IRQ 18
Mar 15 20:16:38 server pvedaemon[2795]: VM 1 started
it works, but no signal at all:

(on guest:)
Code:
00:05.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 10
    Memory at f2010000 (32-bit, non-prefetchable) [size=64K]
    I/O ports at c080 [size=32]
    Kernel driver in use: b2c2_flexcop_pci
    Kernel modules: b2c2-flexcop-pci
but:
Code:
vdr:~# scan -c
using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
WARNING: filter timeout pid 0x0011
WARNING: filter timeout pid 0x0000
dumping lists (0 services)
Done.
I guess it's no vdr but a kvm problem, the same VDR version works very well when it's not virtualised ;)


any ideas, what i could do?

In addition i have figured out this on the host:
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 18
    Memory at fcff0000 (32-bit, non-prefetchable) [size=64K]
    I/O ports at dc00 [size=32]
    Kernel driver in use: pci-stub
    Kernel modules: b2c2-flexcop-pci

01:09.0 Multimedia controller: Philips Semiconductors SAA7146 (rev 01)
    Subsystem: TERRATEC Electronic GmbH Cinergy 1200 DVB-S
    Flags: medium devsel, IRQ 19
    Memory at fcfefc00 (32-bit, non-prefetchable) [size=512]
    Kernel driver in use: pci-stub
    Kernel modules: budget-av

Why one is detected as a Multimedia Controller and the other one as Network controller?

Thank you :)