iommu/vt-d: Deduplicate cache_tag_flush_all by reusing flush_range
authorEthan Milon <ethan.milon@eviden.com>
Mon, 14 Jul 2025 04:50:28 +0000 (12:50 +0800)
committerWill Deacon <will@kernel.org>
Mon, 14 Jul 2025 10:18:04 +0000 (11:18 +0100)
commite934464e098ebfc212c72d3022f1d31b88929768
treef2cab5dd2c7dc9938dc4af65b1193f296863701c
parent3141153816bf4f0257747bd4dda176d38f1a9a49
iommu/vt-d: Deduplicate cache_tag_flush_all by reusing flush_range

The logic in cache_tag_flush_all() to iterate over cache tags and issue
TLB invalidations is largely duplicated in cache_tag_flush_range(), with
the only difference being the range parameters.

Extend cache_tag_flush_range() to handle a full address space flush when
called with start = 0 and end = ULONG_MAX. This allows
cache_tag_flush_all() to simply delegate to cache_tag_flush_range()

Signed-off-by: Ethan Milon <ethan.milon@eviden.com>
Link: https://lore.kernel.org/r/20250708214821.30967-2-ethan.milon@eviden.com
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Link: https://lore.kernel.org/r/20250714045028.958850-12-baolu.lu@linux.intel.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/iommu/intel/cache.c
drivers/iommu/intel/trace.h