Bugzilla – Bug 1216464
Broken PCI Pass trough under LibVirt (KVM+Qemu).
Last modified: 2024-03-12 20:47:09 UTC
Without enabling IOMMU and load vfio-pci, there is possibility of hang system during poweroff and hang virt-manager. Virt-manager does not complains about missing option, or does not clarify what happens, just running VM is broken after trying to pass through PCI device without do some task earlier. Solution: made virt-manager check if IOMMU is enabled, etc. If check fail, show message explaining, what user should do. Solution 2: add virtualization configure page to Yast-OpenSUSE-Installer. User could select server role, so add virtualization checkbox somewhere near. If checked and user press next, virtualization configuration page will appear, where user could add devices to pass through. If user do that, then check CPU type, enable IOMMU and configure vfio-pci module. Maybe integrate it with Virtualization page under Yast in future?
(In reply to Sławomir Lach from comment #0) > Solution: made virt-manager check if IOMMU is enabled, etc. If check fail, > show message explaining, what user should do. Or use the virt-host-validate tool from the libvirt-daemon-common package. > Solution 2: add virtualization configure page to Yast-OpenSUSE-Installer. > User could select server role, so add virtualization checkbox somewhere > near. If checked and user press next, virtualization configuration page will > appear, where user could add devices to pass through. If user do that, then > check CPU type, enable IOMMU and configure vfio-pci module. > Maybe integrate it with Virtualization page under Yast in future? Perhaps the 'Install hypervisor and tools' yast module could add 'intel_iommu=on' to the kernel cmdline, if it doesn't do so already. IIRC, libvirt will automatically load the vfio-pci module if needed.
(In reply to James Fehlig from comment #1) > (In reply to Sławomir Lach from comment #0) > > Solution: made virt-manager check if IOMMU is enabled, etc. If check fail, > > show message explaining, what user should do. > > Or use the virt-host-validate tool from the libvirt-daemon-common package. > > > Solution 2: add virtualization configure page to Yast-OpenSUSE-Installer. > > User could select server role, so add virtualization checkbox somewhere > > near. If checked and user press next, virtualization configuration page will > > appear, where user could add devices to pass through. If user do that, then > > check CPU type, enable IOMMU and configure vfio-pci module. > > Maybe integrate it with Virtualization page under Yast in future? > > Perhaps the 'Install hypervisor and tools' yast module could add > 'intel_iommu=on' to the kernel cmdline, if it doesn't do so already. IIRC, > libvirt will automatically load the vfio-pci module if needed. I believe this is already set by default in our kernels. Running, cat /proc/config.gz | gunzip | grep IOMMU will show among the options, CONFIG_AMD_IOMMU=y CONFIG_INTEL_IOMMU=y
The feature is not broken, just not user friendly to use and it requires setup outside the virtualization tools. Setting up PCI passthrough requires host level configuration and virt-manager does not check or report on whether that has been done. Having the 'Install hypervisor and tools' yast module add the kernel command line option automatically may not be correct for all users of virtualization so it would need to be presented as a question (or checkbox) before enabling. In either case, this bug sounds more like a feature request to improve how PCI pasthrough is configured.