mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 05:35:20 +00:00
virtio-devices: Removing all mappings found in an unmap request
According to the virtio iommu spec (section 5.13.6.6), all mappings within the entire range from virt_start to virt_end in an unmap request must be removed. This change adds this functionality, iterating through all mappings that fall within an unmap request for that domain and removing them. Signed-off-by: Andrew Carp <acarp@crusoeenergy.com>
This commit is contained in:
parent
6bee8ac702
commit
fbdc5d4487
@ -563,7 +563,7 @@ impl Request {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove mapping associated with the domain
|
// Remove all mappings associated with the domain within the requested range
|
||||||
mapping
|
mapping
|
||||||
.domains
|
.domains
|
||||||
.write()
|
.write()
|
||||||
@ -571,7 +571,7 @@ impl Request {
|
|||||||
.get_mut(&domain_id)
|
.get_mut(&domain_id)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.mappings
|
.mappings
|
||||||
.remove(&virt_start);
|
.retain(|&x, _| (x < req.virt_start || x > req.virt_end));
|
||||||
}
|
}
|
||||||
VIRTIO_IOMMU_T_PROBE => {
|
VIRTIO_IOMMU_T_PROBE => {
|
||||||
if desc_size_left != size_of::<VirtioIommuReqProbe>() {
|
if desc_size_left != size_of::<VirtioIommuReqProbe>() {
|
||||||
|
Loading…
Reference in New Issue
Block a user