Re: [PATCH v2 2/5] iommu/amd: Fix DTE clearing and rename iommu_ignore_device()
Pranjal Shrivastava <[email protected]>
| Newsgroups | dev.linux.lists.iommu,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pci |
|---|---|
| Message-ID | <[email protected]> |
On Sat, Aug 22, 2026 at 07:28:20PM +0530, Vasant Hegde wrote:
>
>
[...]
> >
> > -static void iommu_ignore_device(struct amd_iommu *iommu, struct device *dev)
> > -{
> > - struct amd_iommu_pci_seg *pci_seg = iommu->pci_seg;
> > - struct dev_table_entry *dev_table = get_dev_table(iommu);
> > - int devid, sbdf;
> > -
> > - sbdf = get_device_sbdf_id(dev);
> > - if (sbdf < 0)
> > - return;
> > -
> > - devid = PCI_SBDF_TO_DEVID(sbdf);
> > - pci_seg->rlookup_table[devid] = NULL;
> > - memset(&dev_table[devid], 0, sizeof(struct dev_table_entry));
> > -
> > - setup_aliases(iommu, dev);
> > -}
> >
> >
> > /****************************************************************************
> > @@ -2233,6 +2217,41 @@ static void dev_update_dte(struct iommu_dev_data *dev_data, bool set)
> > clear_dte_entry(iommu, dev_data);
> > }
> >
> > +/*
> > + * Invalidate a DTE by clearing the Valid bit first.
> > + * Note: Not to be used on a fully probed device with
> > + * live dev_data.
> > + */
> > +static void amd_iommu_disable_dte(struct dev_table_entry *ptr)
> > +{
> > + struct dev_table_entry new = {};
> > +
> > + write_dte_lower128(ptr, &new);
> > + write_dte_upper128(ptr, &new);
> > +}
> > +
> > +static void iommu_disable_device_dma(struct amd_iommu *iommu, struct device *dev)
>
> This will disable interrupt remapping support as well. May be we should rename
> this function.
>
Ack, Sure. How about iommu_disable_device() ?
> Otherwise patch looks good.
>
Thanks,
Praan