Red Hat Bugzilla – Bug 1449067
[RFE] Device passthrough support for VT-d emulation
Last modified: 2018-04-10 20:21:57 EDT
Description of problem: VT-d has special support for passthrough mode. Let's support that feature in our VT-d emulation. That'll benefit us when guest is using "iommu=pt" mode. We'll avoid having an identity mapping, which will not only lock up all guest memory, but also slower than hardware passthrough mode (which is what we are going to support). Version-Release number of selected component (if applicable): N/A How reproducible: N/A Steps to Reproduce: (hardware passthrough mode is not only for vfio-pci device, but here we use this device to detect whether it's working by observing some warning messages) Start guest with vfio-pci device: bin=x86_64-softmmu/qemu-system-x86_64 $bin -M q35,accel=kvm,kernel-irqchip=split -m 2G \ -device intel-iommu,intremap=on,caching-mode=on \ -device vfio-pci,host=00:19.0 \ /var/lib/libvirt/images/fedora-25.qcow2 Actual results: When without passthrough mode support, we'll see some warnings like: qemu-system-x86_64: iommu has granularity incompatible with target AS or/and: qemu-system-x86_64: iommu map to non memory area 180000000 Expected results: See no warnings. (Actually, guest will boot slightly faster)
Current upstream work: https://lists.gnu.org/archive/html/qemu-devel/2017-04/msg02583.html
The block field is incorrect. I was meaning bug 1448813, but now I would prefer no dependency since we'll postpone this bug to 7.5 and we need to solve the crash in bug 1448813. As a conclusion, I'm removing the blocker.
Posted: http://post-office.corp.redhat.com/archives/rhvirt-patches/2017-October/msg00245.html
Fix included in qemu-kvm-rhev-2.10.0-3.el7
qemu command line: /usr/libexec/qemu-kvm \ -M q35,accel=kvm,kernel-irqchip=split \ -m 2G \ -cpu SandyBridge,enforce \ -device intel-iommu,intremap=on,caching-mode=on,id=viommu \ -device pcie-root-port,id=root0,slot=1 \ -device pcie-root-port,id=root1,slot=2 \ -drive file=/home/rhel74-64-virtio.qcow2,if=none,id=drive-virtio-blk-disk,format=qcow2,cache=none \ -device virtio-blk-pci,bus=root0,drive=drive-virtio-blk-disk \ -monitor stdio \ -vga qxl \ -vnc :0 \ -device vfio-pci,host=83:00.0,id=pf,rombar=0,bus=root1 \ Test steps: 1. Prepare a guest with "intel_iommu=on iommu=pt" in kernel line 2. Boot the vm with the command line above, key device: -M q35,accel=kvm,kernel-irqchip=split \ -device intel-iommu,intremap=on,caching-mode=on,id=viommu \ -device vfio-pci,host=83:00.0,id=pf,rombar=0,bus=root1 \ ---------------------reproduce--------------- Reproduce this bz with RHEL7.4.z, as this issue exist before rebase to 2.10. Test version: qemu-kvm: qemu-img-rhev-2.9.0-16.el7_4.10.x86_64 After during guest booting, qemu monitor promote: (qemu) qemu-kvm: iommu has granularity incompatible with target AS reproduce this issue successfully. ---------------------verification--------------- Test version: qemu-kvm: qemu-kvm-rhev-2.10.0-3.el7 Guest can boot up without the warning, and run normally. According to the test result above, move to VERIFIED.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2018:1104