PCI Passthrough Issue

Nils

New Member
Jan 19, 2014
7
0
1
Hi there!

I am trying to pass a PCI Graphics Card (HIS Radeon R7 260x) to a Win7 VM.

I did the steps I could find on the internet / in this forum:

- Identifying the device with lspci -n

- freeing the card from any drivers (two devices, one is gfx, the other snd hdmi device)

echo "1002 6658" > /sys/bus/pci/drivers/pci-stub/new_id
echo "0000:01:00.0" > /sys/bus/pci/drivers/ahci/unbind
echo "0000:01:00.0" > /sys/bus/pci/drivers/pci-stub/bind
echo "1002 6658" > /sys/bus/pci/drivers/pci-stub/remove_id

echo "1002 aac0" > /sys/bus/pci/drivers/pci-stub/new_id
echo "0000:01:00.1" > /sys/bus/pci/drivers/ahci/unbind
echo "0000:01:00.1" > /sys/bus/pci/drivers/pci-stub/bind
echo "1002 aac0" > /sys/bus/pci/drivers/pci-stub/remove_id


- Finally adding the devices to the vm via qm monitor:
# device_add pci-assign,host=01:00.0,id=gfx

Host-side INTx sharing not supported, using MSI instead
Some devices do not work properly in this mode.

# device_add pci-assign,host=01:00.1,id=snd


The soundcard seems worked fine (windows driver gets loaded),
but the graphiccard does not load the driver.
There is this yellow exclamation mark sign in the windows device manager.

I assume that this is related to the warning, that Host-side INTx sharing is not supported.
Is there a way to simply switch that on? I read in the forum, that it was turned on by default in some older versions, but caused trouble.

Any suggestions and help is much appreciated!
Nils


 
Just a little update:

It seems that kvm can't handle IRQ sharing here properly.

intel_iommu=on intremap=1 iommu=1
set as kernel cmd line parameters

dmesg output after adding device to vm via qm monitor device_add pci-assign,host=01:00.0,id=gfx

IRQ handler type mismatch for IRQ 16
current handler: ehci_hcd:usb1
Pid: 6081, comm: kvm veid: 0 Tainted: G W --------------- H 2.6.32-26-pve #1
Call Trace:
[<ffffffff810f23f7>] ? __setup_irq+0x3e7/0x440
[<ffffffffa089fc90>] ? kvm_assigned_dev_intr+0x0/0xf0 [kvm]
[<ffffffff810f2534>] ? request_threaded_irq+0xe4/0x1e0
[<ffffffffa08a538d>] ? kvm_vm_ioctl+0xfed/0x10d0 [kvm]
[<ffffffff81295b70>] ? pci_user_read_config_byte+0x70/0xa0
[<ffffffff812a08ea>] ? pci_read_config+0x25a/0x280
[<ffffffffa08a383a>] ? kvm_dev_ioctl+0xaa/0x4c0 [kvm]
[<ffffffff811b45fa>] ? vfs_ioctl+0x2a/0xa0
[<ffffffff81220076>] ? read+0x166/0x210
[<ffffffff811b4c2e>] ? do_vfs_ioctl+0x7e/0x570
[<ffffffff8119fd56>] ? vfs_read+0x116/0x190
[<ffffffff811b516f>] ? sys_ioctl+0x4f/0x80
[<ffffffff8100b182>] ? system_call_fastpath+0x16/0x1b
pci 0000:01:00.0: irq 34 for MSI/MSI-X
pci 0000:01:00.0: restoring config space at offset 0x1 (was 0x100400, writing 0x100407)


Not sure if there is a way to manually map pci devices to interrupts.

IRQ 16 is used by ehci_hcd:usb1

info pci
shows

Bus 0, device 4, function 0:
VGA controller: PCI device 1002:6719
IRQ 0.
BAR0: 64 bit memory at 0xffffffffffffffff [0x0ffffffe].
BAR2: 64 bit memory at 0xffffffffffffffff [0x0001fffe].
BAR4: I/O at 0xffffffffffffffff [0x00fe].
BAR6: 32 bit memory at 0xffffffffffffffff [0x0001fffe].
id "gfx"

and

lspci -vvv -b -s 0000:01:00.0
01:00.0 VGA compatible controller: Advanced Micro Devices [AMD] nee ATI Cayman PRO [Radeon HD 6950] (prog-if 00 [VGA controller])
Subsystem: Hightech Information System Ltd. Device 2010
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin A routed to IRQ 255

lspci -vvv -s 0000:01:00.0
01:00.0 VGA compatible controller: Advanced Micro Devices [AMD] nee ATI Cayman PRO [Radeon HD 6950] (prog-if 00 [VGA controller])
Subsystem: Hightech Information System Ltd. Device 2010
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin A routed to IRQ 34