Subject: Re: [PATCH v6 06/25] iommu/io-pgtable-arm: Rework to use the iommu-pages API

From: Mostafa Saleh <[email-masked]>
Date: Wed, 13 May 2026 21:54:46 +0000

On Mon, May 11, 2026 at 11:18:49AM -0300, Jason Gunthorpe wrote:
> On Mon, May 11, 2026 at 11:16:47AM +0000, Mostafa Saleh wrote:
> > > IDK, why? virt_to_phys() is part of the iommu-pages API, I'd just
> > > leave it.. If you want to narrow it then #define it for pkvm when
> > > compiling this file..
> > 
> > It is not going to be part of the iommu-pages API, I meant in
> > io-pgtable-arm, we will use something arm_lpae_virt_to_phys()...
> > which is then implemented differently for pkvm.
> 
> Again why? I think the main goal should be to not mess up the normal
> code. 
> 
>   #define virt_to_phys pkvm_virt_to_phys
> 
> Does that, we should be leaning into this pattern I think, not adding
> unnecessary churn...
> 
> If anything is needed then it should be an iommu_pages function to
> wrapper virt_to_phys() for use by iommu_pages uses but I'd rather
> not..
> 

Sure, no strong opinion, I did post this patch along with cleanups
separately in:
https://lore.kernel.org/linux-iommu/[email-masked]/

Thanks,
Mostafa

> Jason