[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220725144605.GF3747@nvidia.com>
Date: Mon, 25 Jul 2022 11:46:05 -0300
From: Jason Gunthorpe <jgg@...dia.com>
To: Jean-Philippe Brucker <jean-philippe@...aro.org>
Cc: Baolu Lu <baolu.lu@...ux.intel.com>,
Joerg Roedel <joro@...tes.org>,
Christoph Hellwig <hch@...radead.org>,
Kevin Tian <kevin.tian@...el.com>,
Ashok Raj <ashok.raj@...el.com>, Will Deacon <will@...nel.org>,
Robin Murphy <robin.murphy@....com>,
Jean-Philippe Brucker <jean-philippe@...aro.com>,
Dave Jiang <dave.jiang@...el.com>,
Vinod Koul <vkoul@...nel.org>,
Eric Auger <eric.auger@...hat.com>,
Liu Yi L <yi.l.liu@...el.com>,
Jacob jun Pan <jacob.jun.pan@...el.com>,
Zhangfei Gao <zhangfei.gao@...aro.org>,
Zhu Tony <tony.zhu@...el.com>, iommu@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v10 08/12] iommu/sva: Refactoring
iommu_sva_bind/unbind_device()
On Mon, Jul 25, 2022 at 10:52:40AM +0100, Jean-Philippe Brucker wrote:
> > The iommu core provides the interface to retrieve attached domain with a
> > {device, pasid} pair. Therefore in the smmuv3 driver, the set_dev_pasid
> > could do like this:
>
> Thanks for the example, yes I can do something like this. I maintain that
> attach+detach is clearer, but as long as it can be made to work, fine by
> me
Except it is not clearer, because there isn't actually a detatch in
our model - many things already got messed up in the non-pasid case
because of this confusing assumption.
We have only a "set" operation and set moves between any two domain
configurations.
You don't need to call attach/detach pairs, just repeated attaches,
which is how the normal path works. detach is called in the legacy
flow for the NULL domain
So, creating a pair invites the wrong idea that they actually are a
pair.
> > The check of "(!domain || domain->type == IOMMU_DOMAIN_UNMANAGED)" looks
> > odd, but could get cleaned up after a real blocking domain is added.
> > Then, we can simply check "domain->type == IOMMU_DOMAIN_BLOCKING".
So this is probably a good reason enough not to do it yet, though it
would be nice to get a proper blocking domain concept in the SMMU
driver to support VFIO, it could be done later.
Jason
Powered by blists - more mailing lists