Re: [PATCH v1] iommu: Skip mapping at address 0x0 if it already exists

From: Jason Gunthorpe

Date: Fri Feb 27 2026 - 09:13:46 EST


On Fri, Feb 27, 2026 at 09:06:27AM +0100, Antheas Kapenekakis wrote:
> On Fri, 27 Feb 2026 at 02:03, Jason Gunthorpe <jgg@xxxxxxxx> wrote:
> >
> > On Thu, Feb 26, 2026 at 09:40:10PM +0100, Antheas Kapenekakis wrote:
> > > I am still concerned about unaligned checks. It is a functional change
> > > that can cause regressions in all devices. The approach of this patch
> > > does not affect behavior in other devices. I would like for Jason to
> > > weigh in.
> >
> > I think Robin's solution is very clever, but I share the concern
> > regarding what all the implementations do.
>
> I will send a V3 with a ternary instead. This way, only 0 is affected.
> I will compile test now and test later today. I am impartial with either fix.
>
> ```
> phys_addr = iommu_iova_to_phys(domain, addr ? addr : 1);
> ```

Yeah, that's a good idea

Jason