From: Zhenzhong Duan Date: Thu, 9 Oct 2025 04:01:34 +0000 (-0400) Subject: vfio/listener: Add an assertion for unmap_all X-Git-Tag: v10.2.0-rc1~50^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=271fec6f18492630df2e1b4599ba2de6eb1d0668;p=thirdparty%2Fqemu.git vfio/listener: Add an assertion for unmap_all Currently the maximum of iommu address space is 64bit. So when a maximum iommu memory section is deleted, it's in scope [0, 2^64). Add a assertion for that. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater Link: https://lore.kernel.org/qemu-devel/20251009040134.334251-4-zhenzhong.duan@intel.com Signed-off-by: Cédric Le Goater --- diff --git a/hw/vfio/listener.c b/hw/vfio/listener.c index 1b6e5065a3..2d7d3a4645 100644 --- a/hw/vfio/listener.c +++ b/hw/vfio/listener.c @@ -715,6 +715,7 @@ static void vfio_listener_region_del(MemoryListener *listener, bool unmap_all = false; if (int128_eq(llsize, int128_2_64())) { + assert(!iova); unmap_all = true; llsize = int128_zero(); }