Questions tagged [vfio]

VFIO is a secure userspace driver framework for Linux, making use of hardware IOMMU enforced device isolation. VFIO is often used in conjunction with QEMU/KVM for device assignment to virtual machines.

30 questions
7
votes
1 answer

Can't use pread on a file descriptor for a vfio pci device

So I'm working with qemu kvm for a while and now I need to passthrough PCI devices. I did all required procedures to make this work: enabled iommu, modprobed vfio module, binded device to vfio and checked that vfio group was indeed created,…
igalvez
  • 145
  • 2
  • 10
7
votes
2 answers

Nvidia GPU passthrough fail with code 43

I'm currently trying to pass a nvidia GPU to Windows 10 guest using qemu 2.5 and libvirt 1.3.5. I see "Error 43" on Nvidia GPU in Device Manager. I had tried to hide the hypervisor by adding "kvm=off" and "hv_vendor_id=123456780ab", but it does not…
Sev_Y
  • 115
  • 1
  • 2
  • 8
4
votes
1 answer

Testing a userspace driver that uses VFIO?

I have a possibly-buggy piece of hardware and a possibly-buggy userspace driver for it that relies on the vfio-pci kernel driver. I'd like to test the driver without dealing with the hardware. I imagine the ideal solution would be something like:…
Patrick Collins
  • 10,306
  • 5
  • 30
  • 69
4
votes
3 answers

vfio_dma_map error when passthrough GPU using libvirt

here is the qemu log 2016-08-28T02:52:05.699498Z qemu-system-x86_64: -device vfio-pci,host=01:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on: vfio_dma_map(0x7f67ea3b3e10, 0x100000, 0xbff00000, 0x7f6651d00000) = -12 (Cannot allocate…
SirTeddy
  • 61
  • 2
  • 4
3
votes
1 answer

How do PCIe devices advertise multiple virtual functions to Linux?

SR-IOV lets PCIe devices expose a single physical function and multiple virtual functions. How does the kernel detect that a device supports virtual functions? Is it a part of the PCIe configuration registers? Where in the kernel are devices tested…
Patrick Collins
  • 10,306
  • 5
  • 30
  • 69
3
votes
1 answer

Linux userspace DMA with iommu=on and without VFIO

Is it possible for a Linux user-space application to use its own memory for DMA without being blocked by the IOMMU and without using VFIO? Our application works fine when the iommu is disabled (intel_iommu=off) or in passthrough mode…
Luke Gorrie
  • 467
  • 3
  • 14
3
votes
1 answer

Interrupt handling for assigned Device through VFIO

I'm trying to understand how Interrupt handling works for a device assigned to VM (Guest KVM) through VFIO but didn't get any clue on how it happens? Let's say, I have a device which is directly assigned(Device pass-through) to Guest VM through VFIO…
Amit Singh Tomar
  • 8,380
  • 27
  • 120
  • 199
2
votes
1 answer

When there is a vfio device in the QEMU-KVM VM, it is not able to save (virsh save) the VM, why?

When the QEMU-KVM VM contains a vfio device, the "virsh save" command will not be able to save the VM. So, I am curious why the vfio-device does not support the VM save command. One of the reason I know is that, it will conflict with the VM…
Dahui
  • 106
  • 9
2
votes
1 answer

Does QEMU emulate enough features for vfio to work in the guest?

I'm considering using vfio instead of uio to access a PCI device from userspace code within a QEMU guest. Can Linux running as a x86_64 QEMU guest use the vfio driver to make an emulated PCI device accessible to a userspace program running in the…
davidA
  • 12,528
  • 9
  • 64
  • 96
2
votes
0 answers

Is vfio-pci a userspace driver for all pci devices?

I know that vfio can expose interrupt, DMA and pci I/O to userspace. I read that if someone want to take advantage of vfio for pci devices, he has to unbind the original driver and bind to vfio-pci driver. So my question is, is vfio-pci a userspace…
4va1anch3
  • 427
  • 1
  • 4
  • 13
1
vote
0 answers

How to load vfio driver before ahci driver with mkinitcpio?

Good morning all, I'd want to attach to vfio driver at boot my secondary sata controller in a manjaro os (kernel 5.16.7). Usually, I add the devices in /etc/modprobe.d/vfio.conf, for example: options vfio-pci…
Daniele
  • 31
  • 3
1
vote
1 answer

No Host Display After GPU Passthrough

I am attempting to set up a GPU passthrough to use in a VM on my system. I am using Ubuntu 17.04 and have followed the instructions in the following link successfully after manually blacklisting the nouveau…
NJC
  • 43
  • 1
  • 8
0
votes
0 answers

How to use vfio read and write SSD?

I am using the code from the official document, but I can only get null values,and only the mmap return value of the first region is available in 9 regions. I have tried various methods such as memcpy, read, pread, etc., all of which are null…
ArcPro
  • 1
  • 1
0
votes
0 answers

Sharing Mutex Between Processes in VFIO Mapped Region

So I have one process running on a host machine that creates a shared memory region. This shared memory region is then passed to a process running in a guest VM. The shared memory region gets exposed to the guest process using vfio and I use mmap to…
MUAS
  • 519
  • 1
  • 7
  • 20
0
votes
1 answer

Dpdk20.11.3 cannot bind device to vfio-pci

I am using dpdk to do user space network IO. But I cannot bind eth0 to vfio-pci. My environment vmware workstation 17 pro Ubuntu 20.04 DPDK 20.11.3 What I have done setup two network card: eht0 (using vmxnet3 driver), eth1 (e1000 driver) disable…
1
2