diff --git a/virtio-devices/src/iommu.rs b/virtio-devices/src/iommu.rs index 206e4564b..e3db1662a 100644 --- a/virtio-devices/src/iommu.rs +++ b/virtio-devices/src/iommu.rs @@ -563,7 +563,7 @@ impl Request { } } - // Remove mapping associated with the domain + // Remove all mappings associated with the domain within the requested range mapping .domains .write() @@ -571,7 +571,7 @@ impl Request { .get_mut(&domain_id) .unwrap() .mappings - .remove(&virt_start); + .retain(|&x, _| (x < req.virt_start || x > req.virt_end)); } VIRTIO_IOMMU_T_PROBE => { if desc_size_left != size_of::() {