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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210930082121.444299be@jacob-builder>
Date:   Thu, 30 Sep 2021 08:21:21 -0700
From:   Jacob Pan <jacob.jun.pan@...ux.intel.com>
To:     "Campin, Mike" <mike.campin@...el.com>
Cc:     Jason Gunthorpe <jgg@...dia.com>,
        "iommu@...ts.linux-foundation.org" <iommu@...ts.linux-foundation.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Joerg Roedel <joro@...tes.org>,
        Christoph Hellwig <hch@...radead.org>,
        "Tian, Kevin" <kevin.tian@...el.com>,
        "Luck, Tony" <tony.luck@...el.com>,
        "Jiang, Dave" <dave.jiang@...el.com>,
        "Raj, Ashok" <ashok.raj@...el.com>,
        "Kumar, Sanjay K" <sanjay.k.kumar@...el.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        jacob.jun.pan@...ux.intel.com
Subject: Re: [RFC 0/7] Support in-kernel DMA with PASID and SVA

Hi Mike,

On Thu, 30 Sep 2021 14:22:34 +0000, "Campin, Mike" <mike.campin@...el.com>
wrote:

> I need support for mixed user PASID, kernel PASID and non-PASID use cases
> in the driver.
> 
This specific RFC is for kernel PASID only. User PASID native use is
supported under SVA lib kernel API and /dev/uacce UAPI or driver specific
char dev. Guest PASID is being developed under the new /dev/iommu framework.
Non-PASID kernel use should be under DMA API unchanged from the driver's
POV. In fact, this proposal will map non-PASID and PASID DMA identically.

Thanks,

Jacob

> -----Original Message-----
> From: Jason Gunthorpe <jgg@...dia.com> 
> Sent: Wednesday, September 29, 2021 4:43 PM
> To: Jacob Pan <jacob.jun.pan@...ux.intel.com>
> Cc: iommu@...ts.linux-foundation.org; LKML
> <linux-kernel@...r.kernel.org>; Joerg Roedel <joro@...tes.org>; Christoph
> Hellwig <hch@...radead.org>; Tian, Kevin <kevin.tian@...el.com>; Luck,
> Tony <tony.luck@...el.com>; Jiang, Dave <dave.jiang@...el.com>; Raj,
> Ashok <ashok.raj@...el.com>; Kumar, Sanjay K <sanjay.k.kumar@...el.com>;
> Campin, Mike <mike.campin@...el.com>; Thomas Gleixner
> <tglx@...utronix.de> Subject: Re: [RFC 0/7] Support in-kernel DMA with
> PASID and SVA
> 
> On Wed, Sep 29, 2021 at 03:57:20PM -0700, Jacob Pan wrote:
> > Hi Jason,
> > 
> > On Wed, 29 Sep 2021 16:39:53 -0300, Jason Gunthorpe <jgg@...dia.com>
> > wrote: 
> > > On Wed, Sep 29, 2021 at 12:37:19PM -0700, Jacob Pan wrote:
> > >    
> > > > For #2, it seems we can store the kernel PASID in struct device. 
> > > > This will preserve the DMA API interface while making it PASID
> > > > capable. Essentially, each PASID capable device would have two
> > > > special global
> > > > PASIDs: 
> > > > 	- PASID 0 for DMA request w/o PASID, aka RID2PASID
> > > > 	- PASID 1 (randomly selected) for in-kernel DMA request w/
> > > > PASID  
> > > 
> > > This seems reasonable, I had the same thought. Basically just have 
> > > the driver issue some trivial call:
> > >   pci_enable_pasid_dma(pdev, &pasid)  
> > That would work, but I guess it needs to be an iommu_ call instead of
> > pci_?  
> 
> Which ever makes sense..  The API should take in a struct pci_device and
> return a PCI PASID - at least as a wrapper around a more generic immu api.
> 
> > I think your suggestion is more precise, in case the driver does not 
> > want to do DMA w/ PASID, we can do less IOTLB flush (PASID 0 only).  
> 
> Since it is odd, and it may create overhead, I would do it only when
> asked to do it
> 
> > > Having multiple RID's pointing at the same IO page table is 
> > > something we expect iommufd to require so the whole thing should 
> > > ideally fall out naturally.  
> 
> > That would be the equivalent of attaching multiple devices to the same 
> > IOMMU domain. right?  
> 
> Effectively..
> 
> Jason


Thanks,

Jacob

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ