Re: [PATCH] iommu/vt-d: Fix CACHE_TAG_NESTING_DEVTLB polluting shared variables in flush loop
From: Baolu Lu
Date: Sun Jul 26 2026 - 22:49:49 EST
On 6/23/26 14:01, Guanghui Feng wrote:
In cache_tag_flush_range(), the CACHE_TAG_NESTING_DEVTLB case modifies the
shared local variables 'addr' and 'mask' before falling through to
CACHE_TAG_DEVTLB. This causes all subsequent CACHE_TAG_DEVTLB entries in
the same loop iteration to incorrectly use the full-range flush parameters
(addr=0, mask=MAX_AGAW_PFN_WIDTH) instead of the precisely calculated PSI
range. This is not the intended behavior, as regular DEVTLB entries should
always perform targeted range-based invalidation.
Fix this by having CACHE_TAG_NESTING_DEVTLB directly call
cache_tag_flush_devtlb_psi() with the full-range constants and break,
instead of modifying shared variables and falling through. This ensures
CACHE_TAG_DEVTLB always uses the original calculated addr and mask for
precise range flush.
Signed-off-by: Guanghui Feng<guanghuifeng@xxxxxxxxxxxxxxxxx>
Signed-off-by: Guixin Liu<kanie@xxxxxxxxxxxxxxxxx>
---
drivers/iommu/intel/cache.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
Queued for v7.3-rc1. Thanks a lot!