oasis-tcs / virtio-spec

OASIS Virtual I/O Device TC: Source code for the VIRTIO (Virtual I/O) Specification maintained by the OASIS Virtual I/O Device (VIRTIO) Technical Committee
https://github.com/oasis-tcs/virtio-spec
Other
241 stars 72 forks source link

virtio-iommu: Introduce lazy mode domains and IOTLB_FLUSH request #204

Open eauger opened 2 months ago

eauger commented 2 months ago

At the moment the virtio-iommu offers MAP and UNMAP requests. This means that if the virtio-iommu protects a device with an iotlb we have no other choice but invalidating the device iotlb on UNMAP. This proposal aims at allowing the decoupling of UNMAP commands and domain IOTLB invalidations. This enables lazy mode where iotlb invalidations are deferred and batched. In that prospect we add a new VIRTIO_IOMMU_F_LAZY_IOTLB_FLUSH feature which, when offered allows an endpoint to be attached to a domain in lazy mode. Alongside we introduce a new IOTLB_FLUSH request which allows to invalidate iotlb entries for the whole domain. When the domain is created in lazy mode, the virtio-iommu device knows it will receive IOTLB_FLUSH and it can avoid flushing the device IOTLB on individual UNMAPs.