Re: [PATCH v4 2/4] iommu/amd: Remove iommu_ignore_device()
From: Jason Gunthorpe
Date: Thu Sep 10 2026 - 10:48:07 EST
On Thu, Sep 10, 2026 at 02:26:53PM +0000, Pranjal Shrivastava wrote:
> The iommu_ignore_device() helper was historically called on device
> initialization failure to clear the primary Device Table Entry (DTE) via
> memset() and nullify the rlookup_table entry.
>
> However, clearing the DTE on probe failure is problematic:
> 1. During normal boot, DTEs start out unconfigured (blocking DMA), making
> clearing redundant.
> 2. During kdump boot, pre-existing translations should be kept running
> until deferred attach rather than abruptly clearing them, which risks
> breaking in-flight transfers.
> 3. Writing to the DTE table via memset without flushing the hardware DTE
> cache risks aliasing & torn writes.
> 4. Clearing the rlookup_table entry breaks interrupt remapping for
> devices that fail probe or operate in translation-less modes.
>
> Remove iommu_ignore_device() entirely and simplify the error return
> paths in amd_iommu_probe_device().
>
> Suggested-by: Jason Gunthorpe <jgg@xxxxxxxxxx>
> Suggested-by: Vasant Hegde <vasant.hegde@xxxxxxx>
> Reported-by: sashiko-bot@xxxxxxxxxx
> Closes: https://lore.kernel.org/all/20260529153216.2AD1E1F00899@xxxxxxxxxxxxxxx/
> Signed-off-by: Pranjal Shrivastava <praan@xxxxxxxxxx>
> ---
> drivers/iommu/amd/iommu.c | 24 ++----------------------
> 1 file changed, 2 insertions(+), 22 deletions(-)
Reviewed-by: Jason Gunthorpe <jgg@xxxxxxxxxx>
Jason