[PATCH v4 0/4] iommu/amd: Refactors for ATS robustness

Pranjal Shrivastava posted 4 patches 2 weeks, 1 day ago
drivers/iommu/amd/iommu.c | 164 +++++++++++++++++++-------------------
drivers/pci/ats.c         |   6 +-
2 files changed, 86 insertions(+), 84 deletions(-)
[PATCH v4 0/4] iommu/amd: Refactors for ATS robustness
Posted by Pranjal Shrivastava 2 weeks, 1 day ago
This series forms the second half of the subsystem-wide ATS robustness
updates. The first part (focusing on the core subsystem, Intel, and ARM
SMMUv3) has already been merged upstream [1]. This half addresses the
AMD IOMMU driver and standardizes the PCI ATS API.

In v2, the series has been significantly restructured based on feedback
on v1. 

[v4]
 - https://lore.kernel.org/all/20260824122347.1588592-1-praan@google.com/
 - Dropped iommu_ignore_device() and dropped patch 3 per discussion with
   Jason and Vasant.
 - Renamed iommu_lookup_device() to lookup_device().
 - Cleaned up amd_iommu_probe_device() to return error pointers directly.
 - Collected Reviewed-by tags from Jason, Vasant and Sami.

[v3]
 - Collected Reviewed-by tags from Vasant.
 - Added a comment explaining why devices without DMA translation support
   are not ignored (to preserve interrupt remapping) per Vasant's feedback.
 - Renamed iommu_disable_device_dma() to iommu_disable_device() to
   accurately reflect that it disables both DMA and interrupt remapping.

[v2]
 - https://lore.kernel.org/all/20260814015647.3370124-1-praan@google.com/
 - Patch 1 Refctors the probe path, isolating capabilities into 
   iommu_init_device_caps().
 - Patch 2 renames iommu_ignore_device() to iommu_disable_device_dma().
   Following Jason's suggestion, it invalidates the hardware DTE by
   clearing the Valid bit (lower 128 bits) followed by the upper
   128 bits.  
 - Patch 3 splits the probe error paths to ensure that devices with
   config failures (like PD_MODE_NONE or ATS mismatches) can preserve
   their rlookup_table entries, successfully keeping IRQ remapping 
   functional for bypassed devices.
 - Patch 4 implements the "Fail Hard" pattern for ATS in the AMD driver,
   failing the probe and throwing a WARN_ON() upon ATS configuration or
   enablement failures.
 - Patch 5 enforces the checking of pci_ats_supported() prior to calling
   pci_prepare_ats() across the entire kernel PCI subsystem.

[v1]
 - https://lore.kernel.org/all/20260601134204.2150602-1-praan@google.com/

Thanks,
Praan

[1] https://lore.kernel.org/all/20260615235037.259909-1-praan@google.com/

Pranjal Shrivastava (4):
  iommu/amd: Refactor device probe and capability initialization
  iommu/amd: Remove iommu_ignore_device()
  iommu/amd: Fail probe on ATS configuration failure
  PCI/ATS: Mandate checking pci_ats_supported() before pci_prepare_ats()

 drivers/iommu/amd/iommu.c | 164 +++++++++++++++++++-------------------
 drivers/pci/ats.c         |   6 +-
 2 files changed, 86 insertions(+), 84 deletions(-)

-- 
2.55.0.1003.g10538fe699-goog
Re: [PATCH v4 0/4] iommu/amd: Refactors for ATS robustness
Posted by Joerg Roedel 1 day, 3 hours ago
On Thu, Sep 10, 2026 at 02:26:51PM +0000, Pranjal Shrivastava wrote:
> Pranjal Shrivastava (4):
>   iommu/amd: Refactor device probe and capability initialization
>   iommu/amd: Remove iommu_ignore_device()
>   iommu/amd: Fail probe on ATS configuration failure
>   PCI/ATS: Mandate checking pci_ats_supported() before pci_prepare_ats()
> 
>  drivers/iommu/amd/iommu.c | 164 +++++++++++++++++++-------------------
>  drivers/pci/ats.c         |   6 +-
>  2 files changed, 86 insertions(+), 84 deletions(-)

Applied the iommu parts (1-3), please submit patch 4 through the PCI tree.
Re: [PATCH v4 0/4] iommu/amd: Refactors for ATS robustness
Posted by Pranjal Shrivastava 6 hours ago
On Thu, Sep 24, 2026 at 01:51:45PM +0200, Joerg Roedel wrote:

Hi Bjorn / Joerg,

> On Thu, Sep 10, 2026 at 02:26:51PM +0000, Pranjal Shrivastava wrote:
> > Pranjal Shrivastava (4):
> >   iommu/amd: Refactor device probe and capability initialization
> >   iommu/amd: Remove iommu_ignore_device()
> >   iommu/amd: Fail probe on ATS configuration failure
> >   PCI/ATS: Mandate checking pci_ats_supported() before pci_prepare_ats()
> > 
> >  drivers/iommu/amd/iommu.c | 164 +++++++++++++++++++-------------------
> >  drivers/pci/ats.c         |   6 +-
> >  2 files changed, 86 insertions(+), 84 deletions(-)
> 
> Applied the iommu parts (1-3), please submit patch 4 through the PCI tree.

Thanks for applying patches 1-3.

Shall I send patch 4 separately or can it be picked into the PCI tree
directly?

Thanks,
Praan