我正在尝试将PCIe设备连接到我的KVM域。我在一个IOMMU组中有两个设备(#28):
03:00.0 PCI bridge: Texas Instruments XIO2001 PCI Express-to-PCI Bridge
04:00.0 Multimedia audio controller: Texas Instruments TMS320C6414 TMS320C6415 TMS320C6416和lspci -n值:
03:00.0 0604: 104c:8240
04:00.0 0401: 104c:a106我正在运行Ubuntu 14.04。我有:
kvm-ok打印加速已全部设置,芯片组支持VT-d。ls -l /sys/bus/pci/devices/0000\:03\:00.0/下列出的驱动程序因此,我这样做是为了将设备绑定到vfio:
# echo "104c a106" > /sys/bus/pci/drivers/vfio-pci/new_id
# echo "104c 8240" > /sys/bus/pci/drivers/vfio-pci/new_id然后:
root@tupac:~# echo "0000:03:00.0" > /sys/bus/pci/drivers/vfio-pci/bind
bash: echo: write error: No such device但是,多媒体控制器显示为AOK:
root@tupac:~# ls -l /sys/bus/pci/drivers/vfio-pci/
total 0
lrwxrwxrwx 1 root root 0 Feb 24 13:07 0000:04:00.0 -> ../../../../devices/pci0000:00/0000:00:02.2/0000:03:00.0/0000:04:00.0
--w------- 1 root root 4096 Feb 24 13:05 bind
lrwxrwxrwx 1 root root 0 Feb 24 13:07 module -> ../../../../module/vfio_pci
--w------- 1 root root 4096 Feb 24 13:15 new_id
--w------- 1 root root 4096 Feb 23 19:47 remove_id
--w------- 1 root root 4096 Feb 23 19:43 uevent
--w------- 1 root root 4096 Feb 24 13:07 unbind03:00.0 (这是一个PCIe到PCI适配器)不会出现在vfio-pci的S设备下。同样地,当我试图使用kvm托管配置时,我会得到:
virsh # start rivendell
error: Failed to start domain rivendell
error: Failed to bind PCI device '0000:03:00.0' to vfio-pci: No such device在syslog下,我得到了我认为是PCIe EINVAL代码的代码:
Feb 23 19:46:46 tupac kernel: [ 214.159625] vfio-pci: probe of 0000:03:00.0 failed with error -22是什么引起的?这是否与适配器后面的系统中存在PCI总线有关?
发布于 2016-02-25 01:57:04
vfio-pci不支持桥接器。
与关于iommu组需要一起分配的建议相反,适当的做法是只在桥的另一边分配设备,然后在客人中显示得很好。
发布于 2021-03-13 02:35:18
这个论坛带我到了这个github回购,它包含脚本vfio bind.sh,它在试图将第二个无线网卡绑定到vfio驱动程序时为我修复了这个问题。
语法为vfio-pci-bind.sh 0000:00:00.0,其中0000:00:00.0是设备ID。
https://unix.stackexchange.com/questions/265541
复制相似问题