Re: [PATCH v1] iommu: Skip mapping at address 0x0 if it already exists
From: Antheas Kapenekakis
Date: Tue Feb 24 2026 - 04:22:21 EST
On Tue, 24 Feb 2026 at 09:26, Vasant Hegde <vasant.hegde@xxxxxxx> wrote:
>
> Hi Antheas,
>
> On 2/23/2026 1:16 PM, Antheas Kapenekakis wrote:
> > [You don't often get email from lkml@xxxxxxxxxxx. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
> >
> > On Mon, 23 Feb 2026 at 07:02, Vasant Hegde <vasant.hegde@xxxxxxx> wrote:
> >>
> >> Antheas,
> >>
> >> On 2/22/2026 5:20 AM, Antheas Kapenekakis wrote:
> >>> Commit 789a5913b29c ("iommu/amd: Use the generic iommu page table")
> >>> introduces the shared iommu page table for AMD IOMMU. Some bioses
> >>> contain an identity mapping for address 0x0, which is not parsed
> >>> properly (e.g., certain Strix Halo devices). This causes the DMA
> >>> components of the device to fail to initialize (e.g., the NVMe SSD
> >>> controller), leading to a failed post.
> >>>
> >>> The failure is caused by iommu_create_device_direct_mappings(), which
> >>> is the new mapping implementation. In it, address aliasing is handled
> >>> via the following check:
> >>>
> >>> ```
> >>> phys_addr = iommu_iova_to_phys(domain, addr);
> >>> if (!phys_addr) {
> >>> map_size += pg_size;
> >>> continue;
> >>> }
> >>> ````
> >>
> >> Thanks for debugging and fixing it . Just wondering why can't we replace replace
> >> above check with pfn_valid() ?
> >>
> >
> > Hi Vasant,
> > I can check later today
> >
> > From a cursory glance though, it does not seem very suitable... Can you expand?
>
> Looking into the details, you are right. It won't work for direct_mapping().
>
>
> May be we can have this patch for now, but I think on long run we should update
> iova_to_phys() ops.
Agreed. This commit can be backported so I would like to see it merged.
When you move forward with the refactor, feel free to cc for me to test
Best,
Antheas
> -Vasant
>
>
>