lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210524115400.52df4d97@jacob-builder>
Date:   Mon, 24 May 2021 11:54:00 -0700
From:   Jacob Pan <jacob.jun.pan@...el.com>
To:     Lu Baolu <baolu.lu@...ux.intel.com>
Cc:     Joerg Roedel <joro@...tes.org>, <ashok.raj@...el.com>,
        <kevin.tian@...el.com>,
        Jean-Philippe Brucker <jean-philippe@...aro.org>,
        <iommu@...ts.linux-foundation.org>, <linux-kernel@...r.kernel.org>,
        jacob.jun.pan@...el.com
Subject: Re: [PATCH 01/11] iommu/vt-d: Add pasid private data helpers

Hi Lu,

On Mon, 24 May 2021 10:16:18 +0800, Lu Baolu <baolu.lu@...ux.intel.com>
wrote:

> Hi Jacob,
> 
> Thanks for reviewing my patch.
> 
> On 5/22/21 5:25 AM, Jacob Pan wrote:
> > Hi BaoLu,
> > 
> > On Thu, 20 May 2021 11:15:21 +0800, Lu Baolu <baolu.lu@...ux.intel.com>
> > wrote:
> >   
> >> We are about to use iommu_sva_alloc/free_pasid() helpers in iommu core.
> >> That means the pasid life cycle will be managed by iommu core. Use a
> >> local array to save the per pasid private data instead of attaching it
> >> the real pasid.
> >>  
> > I feel a little awkward to have a separate xarray for storing per IOASID
> > data. Seems duplicated.
> > Jason suggested in another thread that we can make ioasid_data public
> > and embeded in struct intel_svm, then we can get rid of the private data
> > pointer. ioasid_find will return the ioasid_data, then we can retrieve
> > the private data with container_of.  
> 
> The problem that this patch wants to solve is that the
> iommu_sva_alloc_pasid() will attach the mm pointer to the sva pasid.
> 
>          pasid = ioasid_alloc(&iommu_sva_pasid, min, max, mm);
> 
> Assuming that each sva pasid can have only a single private data
> pointer, the vendor iommu driver shouldn't set the private data again.
> 
You are right. I got confused with vSVM, the guest will have the private
data assigned after the bind.

> > 
> > roughly,
> > 
> > struct intel_svm {
> > 	...
> > 	struct ioasid_data;
> > };
> > 
> > struct ioasid_data {
> > 	ioasid_t id;
> > 	refcount_t refs;
> > 	struct mm_struct *mm;
> > };
> > 
> > This can be a separate patch/effort if it make sense to you.  
> 
> Yes if we have a better solution.
> 
Will be part of the IOASID core change.

Thanks,
> Best regards,
> baolu


Thanks,

Jacob

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ