Jump to content
jonp

Simpler / Easier PCI Device Pass Through for NON-GPUs

93 posts in this topic Last Reply

Recommended Posts

Here you go;

 

Linux 3.19.4-unRAID.
root@UnRaid:~# virsh start MediaServer
error: Failed to start domain MediaServer
error: Requested operation is not valid: PCI device 0000:0e:00.0 is not assignable

 

Ok, let's try this:

 

1)  Stop all your running VMs

2)  Login via SSH or telnet

3)  type the following command:

 

nano /etc/libvirt/qemu.conf

 

4)  Hit CTRL+W on your keyboard (this searches in nano).  Search for the word "relaxed"

5)  Uncomment this line:

 

#relaxed_acs_check = 1

 

6)  Hit CTRL+X on your keyboard to exit, when prompted to save modified buffer, hit "y" for yes

7)  Exit SSH/telnet

8)  Navigate your browser to Settings -> VM Manager

9)  Set "Enable VMs" to No and then to Yes again (restarting libvirt)

10)  Try to start your VM again...

Share this post


Link to post

All done, extended errors now...

 

root@UnRaid:~# virsh start MediaServer
error: Failed to start domain MediaServer
error: internal error: early end of file from monitor: possible problem:
2015-04-25T18:34:34.898771Z qemu-system-x86_64: -device vfio-pci,host=0e:00.0,id=hostdev0,bus=pci.0,addr=0x6: vfio: error, group 14 is not viable, please ensure all devices within the iommu_group are bound to their vfio bus driver.
2015-04-25T18:34:34.898805Z qemu-system-x86_64: -device vfio-pci,host=0e:00.0,id=hostdev0,bus=pci.0,addr=0x6: vfio: failed to get group 14
2015-04-25T18:34:34.898820Z qemu-system-x86_64: -device vfio-pci,host=0e:00.0,id=hostdev0,bus=pci.0,addr=0x6: Device initialization failed.
2015-04-25T18:34:34.898835Z qemu-system-x86_64: -device vfio-pci,host=0e:00.0,id=hostdev0,bus=pci.0,addr=0x6: Device 'vfio-pci' could not be initialized

 

This would be a good juncture to point out that this device is on a PCI/PCIe expansion board. I can try moving it into the system proper and seeing what happens? (goes without saying this hardware config worked OK with Xen).

 

Thanks

 

 

Share this post


Link to post

Oh Dear

 

Just read this;

 

http://vfio.blogspot.ie/2014/08/iommu-groups-inside-and-out.html

 

and did this;

 

$ find /sys/kernel/iommu_groups/ -type l

 

which resulted in this;

 

/sys/kernel/iommu_groups/0/devices/0000:00:00.0
/sys/kernel/iommu_groups/1/devices/0000:00:02.0
/sys/kernel/iommu_groups/2/devices/0000:00:09.0
/sys/kernel/iommu_groups/3/devices/0000:00:0a.0
/sys/kernel/iommu_groups/4/devices/0000:00:0b.0
/sys/kernel/iommu_groups/5/devices/0000:00:0c.0
/sys/kernel/iommu_groups/6/devices/0000:00:0d.0
/sys/kernel/iommu_groups/7/devices/0000:00:11.0
/sys/kernel/iommu_groups/8/devices/0000:00:12.0
/sys/kernel/iommu_groups/8/devices/0000:00:12.2
/sys/kernel/iommu_groups/9/devices/0000:00:13.0
/sys/kernel/iommu_groups/9/devices/0000:00:13.2
/sys/kernel/iommu_groups/10/devices/0000:00:14.0
/sys/kernel/iommu_groups/11/devices/0000:00:14.3
/sys/kernel/iommu_groups/12/devices/0000:00:14.4
/sys/kernel/iommu_groups/12/devices/0000:07:06.0
/sys/kernel/iommu_groups/12/devices/0000:07:0e.0
/sys/kernel/iommu_groups/13/devices/0000:00:14.5
/sys/kernel/iommu_groups/14/devices/0000:00:15.0
/sys/kernel/iommu_groups/14/devices/0000:00:15.1
/sys/kernel/iommu_groups/14/devices/0000:00:15.2
/sys/kernel/iommu_groups/14/devices/0000:00:15.3
/sys/kernel/iommu_groups/14/devices/0000:08:00.0
/sys/kernel/iommu_groups/14/devices/0000:09:00.0
/sys/kernel/iommu_groups/14/devices/0000:10:04.0
/sys/kernel/iommu_groups/14/devices/0000:0a:00.0
/sys/kernel/iommu_groups/14/devices/0000:0b:00.0
/sys/kernel/iommu_groups/14/devices/0000:0c:00.0
/sys/kernel/iommu_groups/14/devices/0000:0c:01.0
/sys/kernel/iommu_groups/14/devices/0000:0c:02.0
/sys/kernel/iommu_groups/14/devices/0000:0e:00.0
/sys/kernel/iommu_groups/14/devices/0000:0f:00.0
/sys/kernel/iommu_groups/15/devices/0000:00:16.0
/sys/kernel/iommu_groups/15/devices/0000:00:16.2
/sys/kernel/iommu_groups/16/devices/0000:01:00.0
/sys/kernel/iommu_groups/16/devices/0000:01:00.1
/sys/kernel/iommu_groups/17/devices/0000:02:00.0
/sys/kernel/iommu_groups/18/devices/0000:03:00.0
/sys/kernel/iommu_groups/19/devices/0000:04:00.0
/sys/kernel/iommu_groups/19/devices/0000:04:00.1
/sys/kernel/iommu_groups/20/devices/0000:05:00.0
/sys/kernel/iommu_groups/20/devices/0000:05:00.1
/sys/kernel/iommu_groups/21/devices/0000:06:00.0
/sys/kernel/iommu_groups/21/devices/0000:06:00.1

 

 

and when compared to my PCI devices list, shows I'm in a world of hurt :-(

 

00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD890 PCI to PCI bridge (external gfx0 port B) (rev 02)
00:00.2 IOMMU: Advanced Micro Devices, Inc. [AMD/ATI] RD990 I/O Memory Management Unit (IOMMU)
00:02.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD890 PCI to PCI bridge (PCI express gpp port B)
00:09.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD890 PCI to PCI bridge (PCI express gpp port H)
00:0a.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD890 PCI to PCI bridge (external gfx1 port A)
00:0b.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD890 PCI to PCI bridge (NB-SB link)
00:0c.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD890S PCI Express bridge for GPP2 port 1
00:0d.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD890 PCI to PCI bridge (external gfx1 port B)
00:11.0 SATA controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 SATA Controller [AHCI mode] (rev 40)
00:12.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:12.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller
00:13.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:13.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller
00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 SMBus Controller (rev 42)
00:14.3 ISA bridge: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 LPC host controller (rev 40)
00:14.4 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 PCI to PCI Bridge (rev 40)
00:14.5 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI2 Controller
00:15.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] SB700/SB800/SB900 PCI to PCI bridge (PCIE port 0)
00:15.1 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] SB700/SB800/SB900 PCI to PCI bridge (PCIE port 1)
00:15.2 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] SB900 PCI to PCI bridge (PCIE port 2)
00:15.3 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] SB900 PCI to PCI bridge (PCIE port 3)
00:16.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:16.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller
00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 0
00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 1
00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 2
00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 3
00:18.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 4
00:18.5 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 5
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Cedar [Radeon HD 5000/6000/7350/8350 Series]
01:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Cedar HDMI Audio [Radeon HD 5400/6300 Series]
02:00.0 USB controller: Etron Technology, Inc. EJ168 USB 3.0 Host Controller (rev 01)
03:00.0 SATA controller: Marvell Technology Group Ltd. 88SE9172 SATA 6Gb/s Controller (rev 12)
04:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Cedar [Radeon HD 5000/6000/7350/8350 Series]
04:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Cedar HDMI Audio [Radeon HD 5400/6300 Series]
05:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Caicos [Radeon HD 6450/7450/8450 / R5 230 OEM]
05:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Caicos HDMI Audio [Radeon HD 6400 Series]
06:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] RV516 [Radeon X1300/X1550 Series]
06:00.1 Display controller: Advanced Micro Devices, Inc. [AMD/ATI] RV516 [Radeon X1300/X1550 Series] (Secondary)
07:06.0 Multimedia audio controller: VIA Technologies Inc. ICE1712 [Envy24] PCI Multi-Channel I/O Controller (rev 02)
07:0e.0 FireWire (IEEE 1394): VIA Technologies, Inc. VT6306/7/8 [Fire II(M)] IEEE 1394 OHCI Controller (rev c0)
08:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 06)
09:00.0 USB controller: Etron Technology, Inc. EJ168 USB 3.0 Host Controller (rev 01)
0a:00.0 SATA controller: Marvell Technology Group Ltd. 88SE9172 SATA 6Gb/s Controller (rev 12)
0b:00.0 PCI bridge: Texas Instruments XIO3130 PCI Express Switch (Upstream) (rev 02)
0c:00.0 PCI bridge: Texas Instruments XIO3130 PCI Express Switch (Downstream) (rev 02)
0c:01.0 PCI bridge: Texas Instruments XIO3130 PCI Express Switch (Downstream) (rev 02)
0c:02.0 PCI bridge: Texas Instruments XIO3130 PCI Express Switch (Downstream) (rev 02)
0e:00.0 Multimedia controller: Digital Devices GmbH Octopus DVB Adapter
0f:00.0 PCI bridge: Texas Instruments XIO2000(A)/XIO2200A PCI Express-to-PCI Bridge (rev 03)
10:04.0 Multimedia audio controller: VIA Technologies Inc. ICE1712 [Envy24] PCI Multi-Channel I/O Controller (rev 02)

 

 

Group 14 contains a bunch of stuff along with the device I want to pass through including SATA controllers, USB controllers, main ethernet etc. - stuff I don't want to be passing through anywhere.

Share this post


Link to post

So u can toggle pcie ACS overrides under vm settings to get around this, but its use at your owns risk. If you didn't have problems in xen, you should not with kvm, but what xen allowed you to do was technically just as risky pcie acs overrides.

Share this post


Link to post

So u can toggle pcie ACS overrides under vm settings to get around this, but its use at your owns risk. If you didn't have problems in xen, you should not with kvm, but what xen allowed you to do was technically just as risky pcie acs overrides.

 

So I did that and rebooted and the VM now boots and passthrough works.

 

Got to read up a bit more on the risk.

 

Gettingthere...

Share this post


Link to post

So u can toggle pcie ACS overrides under vm settings to get around this, but its use at your owns risk. If you didn't have problems in xen, you should not with kvm, but what xen allowed you to do was technically just as risky pcie acs overrides.

 

So I did that and rebooted and the VM now boots and passthrough works.

 

Got to read up a bit more on the risk.

 

Gettingthere...

 

Up until beta 15 I ran with PCIe ACS Override on and can't say I noted any problems with stability.

Share this post


Link to post

Hopefully this is an easy question. I noticed in the "***GUIDE*** Passing Through Network Controllers to unRAID 6 Virtual Machines" a step to add this to the syslinux.cfg:

 

http://lime-technology.com/forum/index.php?topic=39638.0

 

pci-stub.ids=8086:153b

 

...but nowhere in this guide is there mention of editing syslinux for passthrough.

 

Can someone explain this difference and the purpose of adding the "pci-stub" to syslinux?

 

I just finished my unRAID 6 upgrade over the weekend and so far couldn't be happier. I already have a Win10 VM running, and I'd like to pass through my second NIC (so the VM doesn't get traffic routed by the OpenVPN plugin) as well as a PCI TV tuner card. So, I'm currently studying both guides to document my next steps.

Share this post


Link to post

Can someone explain this difference and the purpose of adding the "pci-stub" to syslinux?

 

A NIC is a device that UnRAID will bind, the stub effectively tells UnRAID to leave it alone, it is not allowed to be assigned to it.

This way unRAID won't put it into use, and then you can pass the device through into your requested VM.

 

If you do not use this, it will be assigned to unRAID and not be able to be used for pass through.

 

Basically you stub it, and then add the proper line into your XML for the device slot that is listed.

 

There is more magic going on in the background of the vm manager, as it will silently assign that device automatically to vfio-pci (I think that's still what it uses) for use in the VM.

Share this post


Link to post

Ok, I think I follow. So this explains why the "stub" isn't needed for other PCI devices (such as TV tuners, etc), that unRAID isn't interested in and therefore won't bind?

 

Thanks!

Share this post


Link to post

Ok, I think I follow. So this explains why the "stub" isn't needed for other PCI devices (such as TV tuners, etc), that unRAID isn't interested in and therefore won't bind?

 

Thanks!

 

Exactly!

Share this post


Link to post

Just an FYI.  I am currently using a Windows 7 VM that I did NOT have to use the VFIO Bind process on my passed through Nic TO MAKE THIS POST.  In device manager I see "Intel® 82574L Gigabit Network Connection #2" which happens to be the model of the MB nic on my Tyan S5512GM4NR MB.  I do NOT have the virtual nic defined in the XML any more I removed it once the passed through nic was up and running.  So I don't think you need the VFIO Bind process any more and you can do the simple passthrough outlined here EVEN FOR NICs.

 

 

Here is my XML:

<domain type='kvm' id='7'>
  <name>Online</name>
  <uuid>9e32368f-ae48-f3ce-a836-12a214836dd1</uuid>
  <description>Internet access from here</description>
  <metadata>
    <vmtemplate name="Custom" icon="windows7.png" os="windows7"/>
  </metadata>
  <memory unit='KiB'>3145728</memory>
  <currentMemory unit='KiB'>3145728</currentMemory>
  <memoryBacking>
    <nosharepages/>
    <locked/>
  </memoryBacking>
  <vcpu placement='static'>2</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='2'/>
    <vcpupin vcpu='1' cpuset='3'/>
  </cputune>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-i440fx-2.3'>hvm</type>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv>
      <relaxed state='on'/>
      <vapic state='on'/>
      <spinlocks state='on' retries='8191'/>
    </hyperv>
  </features>
  <cpu mode='host-passthrough'>
    <topology sockets='1' cores='2' threads='1'/>
  </cpu>
  <clock offset='localtime'>
    <timer name='hypervclock' present='yes'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source file='/mnt/cache/VMs/Online/Online.img'/>
      <backingStore/>
      <target dev='hdc' bus='virtio'/>
      <boot order='1'/>
      <alias name='virtio-disk2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source file='/mnt/cache/VMs/raw/Install.img'/>
      <backingStore/>
      <target dev='hdd' bus='virtio'/>
      <alias name='virtio-disk3'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/VMs/ISOs/en_windows_7_professional_with_sp1_x86_dvd_u_677056.iso'/>
      <backingStore/>
      <target dev='hda' bus='ide'/>
      <readonly/>
      <boot order='2'/>
      <alias name='ide0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/VMs/ISOs/virtio-win-0.1.96.iso'/>
      <backingStore/>
      <target dev='hdb' bus='ide'/>
      <readonly/>
      <alias name='ide0-0-1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
    <controller type='usb' index='0'>
      <alias name='usb0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'>
      <alias name='pci.0'/>
    </controller>
    <controller type='ide' index='0'>
      <alias name='ide0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <alias name='virtio-serial0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </controller>
    <serial type='pty'>
      <source path='/dev/pts/1'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/1'>
      <source path='/dev/pts/1'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/Online.org.qemu.guest_agent.0'/>
      <target type='virtio' name='org.qemu.guest_agent.0' state='connected'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='tablet' bus='usb'>
      <alias name='input0'/>
    </input>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='5900' autoport='yes' websocket='5700' listen='0.0.0.0' keymap='en-us'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='vmvga' vram='16384' heads='1'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
      </source>
      <alias name='hostdev0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </hostdev>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </memballoon>
  </devices>
</domain>

 

 

Here is what I added to my XML for the NIC (you can find it above with the address type line added):

    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
      </source>
    </hostdev>

 

 

Here is what I removed from my XML to remove the Virtual NIC:

    <interface type='bridge'>
      <mac address='52:54:00:26:17:ac'/>
      <source bridge='br0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

 

 

Here are my PCI devices:

00:00.0 Host bridge: Intel Corporation Xeon E3-1200 Processor Family DRAM Controller (rev 09)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port (rev 09)
00:01.1 PCI bridge: Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port (rev 09)
00:1a.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 05)
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b5)
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b5)
00:1c.2 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 3 (rev b5)
00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b5)
00:1c.4 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5 (rev b5)
00:1c.5 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 6 (rev b5)
00:1c.6 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 7 (rev b5)
00:1d.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 05)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev a5)
00:1f.0 ISA bridge: Intel Corporation C204 Chipset Family LPC Controller (rev 05)
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family SATA AHCI Controller (rev 05)
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 05)
01:00.0 Serial Attached SCSI controller: LSI Logic / Symbios Logic SAS2008 PCI-Express Fusion-MPT SAS-2 [Falcon] (rev 03)
02:00.0 Serial Attached SCSI controller: LSI Logic / Symbios Logic SAS2008 PCI-Express Fusion-MPT SAS-2 [Falcon] (rev 03)
03:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection
04:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection
05:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection
06:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection
09:00.0 PCI bridge: ASPEED Technology, Inc. AST1150 PCI-to-PCI Bridge (rev 02)
0a:00.0 VGA compatible controller: ASPEED Technology, Inc. ASPEED Graphics Family (rev 10)

 

 

I also attached my syslinux.cfg so that you can see it is still the stock one.

 

 

 

 

syslinux.cfg

Share this post


Link to post

Just an FYI.  I am currently using a Windows 7 VM that I did NOT have to use the VFIO Bind process on my passed through Nic TO MAKE THIS POST.  In device manager I see "Intel® 82574L Gigabit Network Connection #2" which happens to be the model of the MB nic on my Tyan S5512GM4NR MB.  I do NOT have the virtual nic defined in the XML any more I removed it once the passed through nic was up and running.  So I don't think you need the VFIO Bind process any more and you can do the simple passthrough outlined here EVEN FOR NICs.

 

There is more magic going on in the background of the vm manager, as it will silently assign that device automatically to vfio-pci (I think that's still what it uses) for use in the VM.

 

Yes, this is done automatically through using the VM manager, I don't see this referenced as needing to be done within this guide.

Share this post


Link to post

BobPhoenix you're my hero, thanks!

 

My VM XML was nearly identical to yours, so I was able to follow the instructions and pass through the 2nd NIC on the first try. No stub, no reboot of the host.

 

Next up is the PVR software (NextPVR) using the network tuner (HDHomeRun Dual), and then things will really get interesting when I try to passthrough my extra SATA card PCI and TV Tuner card.

 

I'll post the results here when I get around to making those changes.

Share this post


Link to post

Hi Guis

I wanted to pass through my tv tuner card (cine S2)

 

But I get the following error, when I want to start up the VM:

 

Error: unsupported configuration: host doesn't support VFIO pci passthrough.

 

Device:

root@Tower:~# lspci | grep Multi
02:00.0 Multimedia video controller: Micronas Semiconductor Holding AG nGene PCI-Express Multimedia Controller (rev 01)

 

This is my xml

<domain type='kvm'>
  <name>Debian</name>
  <uuid>ba6891bd-32cf-2236-2525-6e12bb490e9c</uuid>
  <memory unit='KiB'>1953125</memory>
  <currentMemory unit='KiB'>1953125</currentMemory>
  <vcpu placement='static'>3</vcpu>
  <os>
    <type arch='i686' machine='pc-i440fx-2.3'>hvm</type>
    <loader type='rom'>/usr/share/qemu/bios-256k.bin</loader>
    <boot dev='cdrom'/>
  </os>
  <features>
    <acpi/>
    <apic eoi='on'/>
    <pae/>
  </features>
  <cpu mode='host-passthrough'>
    <topology sockets='1' cores='3' threads='1'/>
  </cpu>
  <clock offset='localtime'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='yes'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/mnt/cache/vm/Debian_VM/debian.qcow2'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/cache/vm/Debian_VM/debian-7.6.0-amd64-netinst.iso'/>
      <target dev='hdb' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
    <controller type='usb' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'/>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <filesystem type='mount' accessmode='passthrough'>
      <source dir='/mnt/cache/'/>
      <target dir='cache'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </filesystem>
    <interface type='bridge'>
      <mac address='52:54:00:01:f8:a1'/>
      <source bridge='br0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </interface>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='5901' autoport='no' listen='192.168.178.11' keymap='de' sharePolicy='allow-exclusive'>
      <listen type='address' address='192.168.178.11'/>
    </graphics>
    <video>
      <model type='vga' vram='16384' heads='1'>
        <acceleration accel3d='yes' accel2d='yes'/>
      </model>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </hostdev>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </memballoon>
  </devices>
</domain>

 

root@Tower:~# egrep -q '^flags.*(svm|vmx)' /proc/cpuinfo && echo virtualization extensions available
virtualization extensions available

 

Hardware:

AMD Athlon 5350 (Kabini)

ASUS AM1M-A

 

Unraid 6.0.1

 

Starting the VM without

<hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </hostdev>

is no problem at all.

 

How can i check if amd_iommu is enabled?

Any other suggestions?

 

BR

Owel

Share this post


Link to post

I don't think your CPU supports iommu/amd-vi.

What does it say when you push info in the webgui?

Share this post


Link to post

Fuck, it says IOMMU disabled.

But virtualization on Bios is enabled...

BIOS update?

Share this post


Link to post

Hello, is this for PCI devices only, or would it would for an onboard NIC? My mobo has dual ports, I am looking to give the second one solely to a VM.

Share this post


Link to post

Hello, is this for PCI devices only, or would it would for an onboard NIC? My mobo has dual ports, I am looking to give the second one solely to a VM.

 

Well, an on-board network interface belongs to an Ethernet controller, which is a PCI device, even if it's on the mobo (on-board devices are still using the PCI bus).  That said, you got me thinking and I am curious if we can do interface "assignment" without controller passthrough.  I'll have to research this...

Share this post


Link to post

I look into system devices and want to pass through this usb controller.

"00:12.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller"

 

As i understand this should then be like this..

 

    <hostdev mode='subsystem' type='pci' managed='yes'>

      <driver name='vfio'/>

      <source>

        <address domain='0x0000' bus='0x00' slot='0x12' function='0x2'/>

      </source>

    </hostdev>

 

but when i added it, this line is also added, why ??

 

    <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>

Share this post


Link to post

@zunfire: That additional line is added to assign a virtual PCI Slot to the device you have passed through. Its normal. And as its added automagically, its saved you some typing :)

Share this post


Link to post

@billington I see, well pass through works nice, but have one strange behavior that you also maybe can answer.

It seems every time I switch settings between using VNC and the graphic card, my lines in XML disappears completely, maybe its default behavior and I have to decide what to use? :)

Share this post


Link to post

@billington I see, well pass through works nice, but have one strange behavior that you also maybe can answer.

It seems every time I switch settings between using VNC and the graphic card, my lines in XML disappears completely, maybe its default behavior and I have to decide what to use? :)

Once you have used the "Edit XML" option to manually edit the XML you can no longer use the Edit option without losing any custom settings you set via Edit XML.  Is that likely to be your problem?

Share this post


Link to post

Thanks for the answer, yes that was my problem, but it won’t be for long, its only for the moment when am testing things out :)

Share this post


Link to post

Yep,

 

When making changes in the GUI to any VMs, it'll get rid of any custom changes youve made to the XML. I have the extra bits ive added to the XML saved into some text files so i can easily copy\paste them back in if I ever need to.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.