[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a774510d-bc55-4ea5-bc1a-2d31cb5bf589@linux.intel.com>
Date: Mon, 16 Jun 2025 19:33:22 +0800
From: Baolu Lu <baolu.lu@...ux.intel.com>
To: Nicolin Chen <nicolinc@...dia.com>, jgg@...dia.com, kevin.tian@...el.com,
corbet@....net, will@...nel.org
Cc: baolu.lu@...ux.intel.com, bagasdotme@...il.com, robin.murphy@....com,
joro@...tes.org, thierry.reding@...il.com, vdumpa@...dia.com,
jonathanh@...dia.com, shuah@...nel.org, jsnitsel@...hat.com,
nathan@...nel.org, peterz@...radead.org, yi.l.liu@...el.com,
mshavit@...gle.com, praan@...gle.com, zhangzekun11@...wei.com,
iommu@...ts.linux.dev, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-tegra@...r.kernel.org, linux-kselftest@...r.kernel.org,
patches@...ts.linux.dev, mochs@...dia.com, alok.a.tiwari@...cle.com,
vasant.hegde@....com, dwmw2@...radead.org
Subject: Re: [PATCH v6 13/25] iommufd: Add mmap interface
On 6/14/2025 3:14 PM, Nicolin Chen wrote:
> For vIOMMU passing through HW resources to user space (VMs), allowing a VM
> to control the passed through HW directly by accessing hardware registers,
> add an mmap infrastructure to map the physical MMIO pages to user space.
>
> Maintain a maple tree per ictx as a translation table managing mmappable
> regions, from an allocated for-user mmap offset to an iommufd_mmap struct,
> where it stores the real PFN range for an io_remap_pfn_range call.
>
> Keep track of the lifecycle of the mmappable region by taking refcount of
> its owner, so as to enforce user space to unmap the region first before it
> can destroy its owner object.
>
> To allow an IOMMU driver to add and delete mmappable regions onto/from the
> maple tree, add iommufd_viommu_alloc/destroy_mmap helpers.
>
> Reviewed-by: Kevin Tian<kevin.tian@...el.com>
> Signed-off-by: Nicolin Chen<nicolinc@...dia.com>
Reviewed-by: Lu Baolu <baolu.lu@...ux.intel.com>
Powered by blists - more mailing lists