On 07/07/2018 12:05 PM, Paul Durrant wrote: > This patch adds iommu_ops to add (map) or remove (unmap) frames in the > domain's IOMMU mappings, and an iommu_op to synchronize (flush) those > manipulations with the hardware. > > Mappings added by the map operation are tracked and only those mappings > may be removed by a subsequent unmap operation. Frames are specified by the > owning domain and GFN. It is, of course, permissable for a domain to map > its own frames using DOMID_SELF. > > NOTE: The owning domain and GFN must also be specified in the unmap > operation, as well as the BFN, so that they can be cross-checked > with the existent mapping. > > Signed-off-by: Paul Durrant <[email protected]>
The code on the whole looks correct, but I don't see any reference counting. The call to get_paged_gfn() in iommuop_unmap() kind of underlines the issue -- what's to stop the following sequence of events? * iommuop_map() page A * share(A) * DMA write into A # -George _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
