[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251029144916.GO760669@ziepe.ca>
Date: Wed, 29 Oct 2025 11:49:16 -0300
From: Jason Gunthorpe <jgg@...pe.ca>
To: Shuai Xue <xueshuai@...ux.alibaba.com>
Cc: iommu@...ts.linux.dev, kevin.tian@...el.com, joro@...tes.org,
	will@...nel.org, robin.murphy@....com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] iommu: iommufd: Explicitly check for VM_PFNMAP in
 iommufd_ioas_map
On Wed, Oct 29, 2025 at 10:44:31PM +0800, Shuai Xue wrote:
> We run different VMMs (QEMU, Kata Containers) to meet diverse business
> requirements, while our production environment deploys various evolving
> kernel versions. Additionally, we are migrating from VFIO Type 1 to
> IOMMUFD. Although IOMMUFD claims to provide compatible
> iommufd_vfio_ioctl APIs, these APIs are not fully compatible in
> practice. 
Well, it aims to, but we are not there yet. Hopefully in the coming
months the MMIO to VFIO will be supported in type 1 emulation as well.
But broadly the EFAULT return here always means the underlying VMA is
incompatible with IOMMUFD, I'm not sure there is that much value in
further determining why exactly it is incompatible.
> Aha, I see. Thank you for pointing out this issue. The check indeed
> needs to be more comprehensive. Do you mind use pin_user_pages() as a
> precheck?
I mean we already call pin_user_pages deep inside the mapping code and
propogate whatever error code it gives back up to userspace. If it
gives a more specific code then it will be returned naturally, no need
to change iommufd at all.
Jason
Powered by blists - more mailing lists
 
