[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 9 Sep 2022 09:54:07 +0800
From: Baolu Lu <baolu.lu@...ux.intel.com>
To: Jason Gunthorpe <jgg@...dia.com>,
Jean-Philippe Brucker <jean-philippe@...aro.org>
Cc: baolu.lu@...ux.intel.com, Joerg Roedel <joro@...tes.org>,
Christoph Hellwig <hch@...radead.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
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>,
Fenghua Yu <fenghua.yu@...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-pci@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v13 09/13] iommu/sva: Refactoring
iommu_sva_bind/unbind_device()
On 2022/9/9 0:41, Jason Gunthorpe wrote:
> On Thu, Sep 08, 2022 at 05:25:32PM +0100, Jean-Philippe Brucker wrote:
>> On Wed, Sep 07, 2022 at 02:33:11PM -0300, Jason Gunthorpe wrote:
>>> On Wed, Sep 07, 2022 at 10:54:54AM +0100, Jean-Philippe Brucker wrote:
>>>
>>>> Is iommu_domain still going to represent both a device context (whole
>>>> PASID table) and individual address spaces, or are you planning to move
>>>> away from that? What happens when a driver does:
>>>>
>>>> d1 = iommu_domain_alloc()
>>>> iommu_attach_device(d1)
>>>> d2 = iommu_sva_bind_device()
>>>> iommu_detach_device(d1)
>>>>
>>>> Does detach
>>>> (a) only disable the non-PASID address space?
>>>> (b) disable everything?
>>>> (c) fail because the driver didn't unbind first?
>>> I think it must be (a), considering how everything is defined and the
>>> needs for vIOMMU emulation.
>> Yes (a) is probably better. The SMMU driver currently implements (c) to
>> ensure that you can't switch device driver without unbinding everything
>> first, and we should keep that check somewhere
> Yes, the owner stuff is a logical place to put that, when ownership
> is all released the PASID table of the group must be empty. Lu?
I agree. The ownership is about the whole device (more precisely,
group), including the RID and PASIDs. When the ownership is converted,
the pasid array must be empty. I will add code in this series to enforce
this. Thanks for pointing out this.
Best regards,
baolu
Powered by blists - more mailing lists