]> xenbits.xensource.com Git - xen.git/commit
iommu: elide flushing for higher order map/unmap operations
authorPaul Durrant <paul.durrant@citrix.com>
Mon, 17 Dec 2018 09:22:58 +0000 (09:22 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 3 Jan 2019 10:36:06 +0000 (10:36 +0000)
commite8afe1124cc11259fcd9942ff5af9c1b2bd329ca
tree450be872cffc71c6235daa459d055d84edb240e2
parentd40029c844cf26802b50a41e02708eb33be54ff9
iommu: elide flushing for higher order map/unmap operations

This patch removes any implicit flushing that occurs in the implementation
of map and unmap operations and adds new iommu_map/unmap() wrapper
functions. To maintain semantics of the iommu_legacy_map/unmap() wrapper
functions, these are modified to call the new wrapper functions and then
perform an explicit flush operation.

Because VT-d currently performs two different types of flush dependent upon
whether a PTE is being modified versus merely added (i.e. replacing a non-
present PTE) 'iommu flush flags' are defined by this patch and the
iommu_ops map_page() and unmap_page() methods are modified to OR the type
of flush necessary for the PTE that has been populated or depopulated into
an accumulated flags value. The accumulated value can then be passed into
the explicit flush operation.

The ARM SMMU implementations of map_page() and unmap_page() currently
perform no implicit flushing and therefore the modified methods do not
adjust the flush flags.

NOTE: The per-cpu 'iommu_dont_flush_iotlb' is respected by the
      iommu_legacy_map/unmap() wrapper functions and therefore this now
      applies to all IOMMU implementations rather than just VT-d.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Acked-by: Julien Grall <julien.grall@arm.com>
Acked-by: Brian Woods <brian.woods@amd.com>
xen/arch/arm/p2m.c
xen/common/memory.c
xen/drivers/passthrough/amd/iommu_map.c
xen/drivers/passthrough/arm/smmu.c
xen/drivers/passthrough/iommu.c
xen/drivers/passthrough/vtd/iommu.c
xen/drivers/passthrough/x86/iommu.c
xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
xen/include/xen/iommu.h