You are not logged in.

#1 2016-05-05 08:05:32

asbel
Member
Registered: 2016-05-05
Posts: 1

Passthrough w/ OVMF / QEMU - 'permission denied'

I've been using the wiki to setup a VM with PCI/GPU passthrough, and managed everything successfully so far up to Step 8: QEMU commands. If relevant, I'm running with kernel 4.5.1-1, i5-6600k, AMD R9 290X, Gigabyte Z170-HD3, using Cinnamon.

I am using vfio-pci, not pci-stub.

Feeding QEMU commands works fine up until here:

$ qemu-system-x86_64 -device vfio-pci,host=01:00.0
qemu-system-x86_64: -device vfio-pci,host=01:00.0: vfio: error opening /dev/vfio/1: Permission denied
qemu-system-x86_64: -device vfio-pci,host=01:00.0: vfio: failed to get group 1
qemu-system-x86_64: -device vfio-pci,host=01:00.0: Device initialization failed

The problem is I already ensured that /etc/libvirt/qemu.conf has correct settings as per wiki, including access to /dev/vfio/1, so QEMU shouldn't be having persmission problems. My /etc/modprobe.d/vfio.conf currently has:

options vfio-pci ids=8086:1901,1002:67b0,1002:aac8

Where, in order, is the Skylake PCIex16 controller, the 290X VGA, and the 290X sound. Passed through the controller as they're in the same IOMMU group and, per the wiki:

An IOMMU group is the smallest set of physical devices that can be passed to a virtual machine. For instance, in the example above, both the GPU in 06:00.0 and its audio controller in 6:00.1 belong to IOMMU group 13 and can only be passed be passed (sic) together.

Here's what lspci -nnk -d returns for each:

$ lspci -nnk -d 8086:1901
00:01.0 PCI bridge [0604]: Intel Corporation Skylake PCIe Controller (x16) [8086:1901] (rev 07)
	Kernel driver in use: pcieport
	Kernel modules: shpchp
$ lspci -nnk -d 1002:67b0
01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Hawaii XT [Radeon R9 290X] [1002:67b0]
	Subsystem: Micro-Star International Co., Ltd. [MSI] R9 290X Lightning [1462:3070]
	Kernel driver in use: vfio-pci
	Kernel modules: radeon
$ lspci -nnk -d 1002:aac8
01:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Hawaii HDMI Audio [1002:aac8]
	Subsystem: Micro-Star International Co., Ltd. [MSI] Device [1462:aac8]
	Kernel driver in use: vfio-pci
	Kernel modules: snd_hda_intel

I had initially tried up until this step without adding the Skylake controller (with the exact same results), went and added it to vfio.conf, double checked mkinitcpio.conf (I'm also not using any other drivers with early modesetting), regenerated initramfs with mkinitcpio -p linux, rebooted, and checked dmesg which outputs the following:

$ dmesg | grep -i vfio
[    0.346431] VFIO - User Level meta-driver version: 0.3
[    0.347698] vfio_pci: add [8086:1901[ffff:ffff]] class 0x000000/00000000
[    0.361266] vfio_pci: add [1002:67b0[ffff:ffff]] class 0x000000/00000000
[    0.374625] vfio_pci: add [1002:aac8[ffff:ffff]] class 0x000000/00000000
[    2.120118]  sch_fq_codel ip_tables x_tables ext4 crc16 mbcache jbd2 hid_generic usbhid hid sd_mod atkbd libps2 ahci libahci xhci_pci libata xhci_hcd scsi_mod usbcore usb_common i8042 serio vfio_pci irqbypass vfio_virqfd vfio_iommu_type1 vfio
[   11.863999]  wmi battery intel_lpss i2c_hid acpi_als tpm_infineon kfifo_buf tpm_tis industrialio fjes tpm acpi_pad button processor sch_fq_codel ip_tables x_tables ext4 crc16 mbcache jbd2 hid_generic usbhid hid sd_mod atkbd libps2 ahci libahci xhci_pci libata xhci_hcd scsi_mod usbcore usb_common i8042 serio vfio_pci irqbypass vfio_virqfd vfio_iommu_type1 vfio
[   11.886363]  wmi battery intel_lpss i2c_hid acpi_als tpm_infineon kfifo_buf tpm_tis industrialio fjes tpm acpi_pad button processor sch_fq_codel ip_tables x_tables ext4 crc16 mbcache jbd2 hid_generic usbhid hid sd_mod atkbd libps2 ahci libahci xhci_pci libata xhci_hcd scsi_mod usbcore usb_common i8042 serio vfio_pci irqbypass vfio_virqfd vfio_iommu_type1 vfio

Whereas the wiki example after the last device just ends with

[    2.061326] vfio-pci 0000:06:00.0: enabling device (0100 -> 0103)

I'm really not sure where I've gone wrong here, I made sure to follow the wiki's steps as closely as possible and triple/quadruple check each step to make sure I didn't make any horrendous typos. It's still a definite possibility and I'm really hopeful someone will know the solution. This'll be my first post on the forum as well so I hope formatting is appropriate and easy to read. Thanks in advance for any and all help!

Offline

Board footer

Powered by FluxBB