summaryrefslogtreecommitdiff
path: root/drivers/iommu/intel/iommu.h
diff options
context:
space:
mode:
authorLu Baolu <baolu.lu@linux.intel.com>2024-04-24 15:16:40 +0800
committerJoerg Roedel <jroedel@suse.de>2024-04-26 11:57:46 +0200
commit8ebc22366ed8bb2cbcf215bfa3fabb4f36d10a91 (patch)
treeed876d75fc6f44eb2d07cd6b435b86ad925897b6 /drivers/iommu/intel/iommu.h
parent06792d06798931696dd78f65024de4cc66f2fd5b (diff)
downloadlinux-8ebc22366ed8bb2cbcf215bfa3fabb4f36d10a91.tar.gz
linux-8ebc22366ed8bb2cbcf215bfa3fabb4f36d10a91.tar.bz2
linux-8ebc22366ed8bb2cbcf215bfa3fabb4f36d10a91.zip
iommu/vt-d: Use cache_tag_flush_range() in cache_invalidate_user
The cache_invalidate_user callback is called to invalidate a range of caches for the affected user domain. Use cache_tag_flush_range() in this callback. Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com> Link: https://lore.kernel.org/r/20240416080656.60968-9-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/intel/iommu.h')
-rw-r--r--drivers/iommu/intel/iommu.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/iommu/intel/iommu.h b/drivers/iommu/intel/iommu.h
index cb83b0995391..1d705a983dd7 100644
--- a/drivers/iommu/intel/iommu.h
+++ b/drivers/iommu/intel/iommu.h
@@ -1049,6 +1049,12 @@ static inline unsigned long aligned_nrpages(unsigned long host_addr, size_t size
return PAGE_ALIGN(host_addr + size) >> VTD_PAGE_SHIFT;
}
+/* Return a size from number of VTD pages. */
+static inline unsigned long nrpages_to_size(unsigned long npages)
+{
+ return npages << VTD_PAGE_SHIFT;
+}
+
/* Convert value to context PASID directory size field coding. */
#define context_pdts(pds) (((pds) & 0x7) << 9)