Re: [PATCH 1/2] iommu/amd: Skip device lookup when IRT caching is disabled
From: Vasant Hegde
Date: Mon Nov 23 2026 - 04:18:31 EST
Hi Guanghui,
On 11/13/2026 3:20 PM, Guanghui Feng wrote:
> The DMA alias invalidation path looks up the device before checking
> irtcachedis_enabled. The lookup walks the PCI segment's device list,
> but its result is unused when IRT caching is disabled.
>
> Nested VM entry and exit can switch multiple interrupt routes between
> guest and remapping modes, repeating this lookup for each IRTE update.
> A reported nested virtualization workload scans 4334 device entries per
> lookup, with median lookup latencies of 22-33 us despite IRT caching
> being disabled.
>
> Move the lookup after the early return. This removes the unnecessary
> list walk without changing alias invalidation or completion handling
> when IRT caching is enabled.
Thanks for the analysis and the patch.
Patch 2/2 removes search_dev_data completely as dev_data is passed to this
function. Do we really need this patch?
-Vasant