On 06/22/23 10:25, David Hildenbrand wrote: > On 22.06.23 09:27, Vivek Kasireddy wrote: > > There are *probably* more issues on the QEMU side when udmabuf is paired > with things like MADV_DONTNEED/FALLOC_FL_PUNCH_HOLE used for virtio-balloon, > virtio-mem, postcopy live migration, ... for example, in the vfio/vdpa case > we make sure that we disallow most of these, because otherwise there can be > an accidental "disconnect" between the pages mapped into the VM (guest view) > and the pages mapped into the IOMMU (device view), for example, after a > reboot. > Yes, this "disconnect" is still possible. Attached is a test program I hacked up based on the udmabuf selftest. You can see different content in the memfd pages and udma pages. FYI- I can verify this new udmabuf code is not accessing struct pages of hugetlb tail pages, as this test program BUG'ed if hugetlb vmemmap optimization was enabled in the old udmabuf. -- Mike Kravetz