> On 12-Mar-19 10:20 AM, Bruce Richardson wrote: >> On Tue, Mar 12, 2019 at 05:54:39PM +0800, Jason Wang wrote: >>> >>> On 2019/3/12 下午5:42, Thanneeru Srinivasulu wrote: >>>> Thanks Bruce.. >>>> >>>> On Tue, Mar 12, 2019 at 3:08 PM Bruce Richardson >>>> <bruce.richardson at intel.com> wrote: >>>>> On Tue, Mar 12, 2019 at 10:57:55AM +0530, Thanneeru Srinivasulu wrote: >>>>>> Hi Everyone. >>>>>> >>>>>> I did attached pice to Guest VM using vfio-pci with qemu command, and >>>>>> then >>>>>> tried binding the pcie bdf with vfio-pci, observing binding failure with >>>>>> vfio-pci. >>>>>> >>>>>> Where as when tryied with igb_uio, everything works fine. >>>>>> >>>>>> Does Binding with vfio-pci is supported inside VM/guest? >>>>>> >>>>> vfio support requires the presence of an IOMMU, and you generally don't >>>>> have an IOMMU available in a VM. >>>>> >>>>> /Bruce >>> >>> >>> Actually, Qemu support vIOMMU + VFIO in guest[1], all you need is to add a >>> intel IOMMU and enabling caching mode. >>> >>> Thanks >>> >>> >>> [1] >>> >>> https://www.lfasiallc.com/wp-content/uploads/2017/11/Device-Assignment-with-Nested-Guests-and-DPDK_Peter-Xu.pdf >>> >> Thanks for the info. >> >> /Bruce >> > > One more thing: even without vIOMMU, VFIO has no-IOMMU mode which can be > enabled (for a recent-enough kernel). This will make VFIO work even in > cases where the guest doesn't have IOMMU emulation. See? There's no > reason to use igb_uio, ever! :D
Agree. You could use following commands to enable no-IOMMU mode: modprobe vfio-pci echo 1 > /sys/module/vfio/parameters/enable_unsafe_noiommu_mode This should allow using vfio-pci driver without IOMMU emulation. However, there will be no any security accordingly. Best regards, Ilya Maximets. > > -- > Thanks, > Anatoly >