All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Jacob Pan <jacob.jun.pan@linux.intel.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	iommu@lists.linux.dev, Lu Baolu <baolu.lu@linux.intel.com>,
	Joerg Roedel <joro@8bytes.org>,
	Jean-Philippe Brucker <jean-philippe@linaro.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Will Deacon <will@kernel.org>,
	"Tian, Kevin" <kevin.tian@intel.com>, Yi Liu <yi.l.liu@intel.com>,
	"Yu, Fenghua" <fenghua.yu@intel.com>,
	Tony Luck <tony.luck@intel.com>
Subject: Re: [PATCH v11 2/8] iommu: Move global PASID allocation from SVA to core
Date: Wed, 2 Aug 2023 11:48:15 -0300	[thread overview]
Message-ID: <ZMpsr3FbcEYRs/G8@nvidia.com> (raw)
In-Reply-To: <20230724222538.3902553-3-jacob.jun.pan@linux.intel.com>

On Mon, Jul 24, 2023 at 03:25:32PM -0700, Jacob Pan wrote:
> Global PASID can be used beyond SVA. For example, drivers that use
> Intel ENQCMD to submit work must use global PASIDs in that PASID
> is stored in a per CPU MSR. When such device need to submit work
> for in-kernel DMA with PASID, it must allocate PASIDs from the same
> global number space to avoid conflict.

This is a bit misleading, maybe:

==
Intel ENQCMD requires a single PASID to be shared between multiple
devices, as the PASID is stored in a single MSR register per-process
and userspace can use only that one PASID.

This means that the PASID allocation for any ENQCMD using device driver
must always come from a shared global pool, regardless of what kind of
domain the PASID will be used with.

Split the code for the global PASID allocator into
iommu_alloc/free_global_pasid() so that drivers can attach non-SVA
domains to PASIDs as well.
==

The code looks fine, though I would eventually like to see the SVA
code not hardwired to the global allocator too :\

Jason

  reply	other threads:[~2023-08-02 14:48 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-24 22:25 [PATCH v11 0/8] Re-enable IDXD kernel workqueue under DMA API Jacob Pan
2023-07-24 22:25 ` [PATCH v11 1/8] iommu: Generalize PASID 0 for normal DMA w/o PASID Jacob Pan
2023-07-24 22:25 ` [PATCH v11 2/8] iommu: Move global PASID allocation from SVA to core Jacob Pan
2023-08-02 14:48   ` Jason Gunthorpe [this message]
2023-08-02 20:55     ` Jacob Pan
2023-07-24 22:25 ` [PATCH v11 3/8] iommu/vt-d: Add domain_flush_pasid_iotlb() Jacob Pan
2023-07-24 22:25 ` [PATCH v11 4/8] iommu/vt-d: Remove pasid_mutex Jacob Pan
2023-07-24 22:25 ` [PATCH v11 5/8] iommu/vt-d: Make prq draining code generic Jacob Pan
2023-07-27  5:48   ` Tian, Kevin
2023-07-24 22:25 ` [PATCH v11 6/8] iommu/vt-d: Prepare for set_dev_pasid callback Jacob Pan
2023-07-27  5:48   ` Tian, Kevin
2023-07-24 22:25 ` [PATCH v11 7/8] iommu/vt-d: Add set_dev_pasid callback for dma domain Jacob Pan
2023-07-27  5:48   ` Tian, Kevin
2023-07-24 22:25 ` [PATCH v11 8/8] dmaengine/idxd: Re-enable kernel workqueue under DMA API Jacob Pan
2023-08-02 14:51   ` Jason Gunthorpe
2023-08-02 14:52 ` [PATCH v11 0/8] Re-enable IDXD " Jason Gunthorpe
2023-08-02 14:53 ` Jacob Pan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZMpsr3FbcEYRs/G8@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=fenghua.yu@intel.com \
    --cc=iommu@lists.linux.dev \
    --cc=jacob.jun.pan@linux.intel.com \
    --cc=jean-philippe@linaro.com \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=tony.luck@intel.com \
    --cc=will@kernel.org \
    --cc=yi.l.liu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.