Re: [PATCH v3 2/5] iommu/amd: Fix DTE clearing and rename iommu_ignore_device()

From: Vasant Hegde

Date: Wed Aug 26 2026 - 07:31:50 EST


Pranjal,


On 8/26/2026 12:38 AM, Pranjal Shrivastava wrote:
> On Tue, Aug 25, 2026 at 02:53:15PM -0300, Jason Gunthorpe wrote:
>> On Tue, Aug 25, 2026 at 05:29:59PM +0000, Pranjal Shrivastava wrote:
>>
>>> I agree, but I wonder why the existing code used memset here
>>> (in ignore_device):
>>>
>>> memset(&dev_table[devid], 0, sizeof(struct dev_table_entry));
>>>
>>> I was thinking it might've been done for probe failures in a kdump
>>> kernel (normal kexec would've called shutdown for clearing all DTEs).
>>> (I see this was added long time back and existed when PCI segments were
>>> added [1]).
>>
>> For kdump you'd want to keep the original translation running in this
>> case.

If probe is failed then we can't do much. Why keep original translation running?

>>
>>> Are you suggesting to remove the DTE clearing from this path entirely?
>>
>> Yes
>>
>
> Even I'm not sure why we had this memset here, I'll just dig into
> the history once if there's anything. Otherwise, I'll simply drop this.
>
> Vasant, please let us know if there was a different context to it?

Looking into git history, it looks like, during boot init_device_table_dma()
sets dte.v bit for all devices. So probe fails then clear everything in DTE.

memset was added long back (commit 26018874e3584) and we never hit any issues.
Hence I guess no one bother to change this.


-Vasant