[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210531181243.GY1002214@nvidia.com>
Date: Mon, 31 May 2021 15:12:43 -0300
From: Jason Gunthorpe <jgg@...dia.com>
To: Parav Pandit <parav@...dia.com>
Cc: "Tian, Kevin" <kevin.tian@...el.com>,
LKML <linux-kernel@...r.kernel.org>,
Joerg Roedel <joro@...tes.org>,
Lu Baolu <baolu.lu@...ux.intel.com>,
David Woodhouse <dwmw2@...radead.org>,
"iommu@...ts.linux-foundation.org" <iommu@...ts.linux-foundation.org>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"Alex Williamson (alex.williamson@...hat.com)"
<alex.williamson@...hat.com>, Jason Wang <jasowang@...hat.com>,
Eric Auger <eric.auger@...hat.com>,
Jonathan Corbet <corbet@....net>,
"Raj, Ashok" <ashok.raj@...el.com>,
"Liu, Yi L" <yi.l.liu@...el.com>, "Wu, Hao" <hao.wu@...el.com>,
"Jiang, Dave" <dave.jiang@...el.com>,
Jacob Pan <jacob.jun.pan@...ux.intel.com>,
Jean-Philippe Brucker <jean-philippe@...aro.org>,
David Gibson <david@...son.dropbear.id.au>,
Kirti Wankhede <kwankhede@...dia.com>,
Robin Murphy <robin.murphy@....com>
Subject: Re: [RFC] /dev/ioasid uAPI proposal
On Mon, May 31, 2021 at 05:37:35PM +0000, Parav Pandit wrote:
> In that case, can it be a new system call? Why does it have to be under /dev/ioasid?
> For example few years back such system call mpin() thought was proposed in [1].
Reference counting of the overall pins are required
So when a pinned pages is incorporated into an IOASID page table in a
later IOCTL it means it cannot be unpinned while the IOASID page table
is using it.
This is some trick to organize the pinning into groups and then
refcount each group, thus avoiding needing per-page refcounts.
The data structure would be an interval tree of pins in general
The ioasid itself would have an interval tree of its own mappings,
each entry in this tree would reference count against an element in
the above tree
Then the ioasid's interval tree would be mapped into a page table tree
in HW format.
The redundant storages are needed to keep track of the refencing and
the CPU page table values for later unpinning.
Jason
Powered by blists - more mailing lists