>-----Original Message----- >From: Liu, Yi L <[email protected]> >Subject: Re: [PATCH 3/3] intel_iommu: Fix DMA failure when guest switches >IOMMU domain > >On 2025/10/15 18:20, Zhenzhong Duan wrote: >> Kernel allows user to switch IOMMU domain, e.g., switch between DMA >> and identity domain. When this happen in IOMMU scalable mode, a pasid >> cache invalidation request is sent, this request is ignored by vIOMMU >> which leads to device binding to wrong address space, then DMA fails. >> >> This issue exists in scalable mode with both first stage and second >> stage translations, both emulated and passthrough devices. > >does it affect emulated device? The domain switching should have >IOTLB/PIOTLB invalidation. right? Then the emulated device should >not been affected.
Yes, because we missed address space switch in vIOMMU, vtd_iommu_translate isn't called even with DMA domain. With a vhost emulated net card, I can get below error, guest hang. qemu-system-x86_64: Fail to lookup the translated address fffff000 qemu-system-x86_64: unable to start vhost net: 14: falling back on userspace virtio qemu-system-x86_64: Guest says index 65535 is available qemu-system-x86_64: Guest moved used index from 0 to 65535 Thanks Zhenzhong
