All of lore.kernel.org
 help / color / mirror / Atom feed
From: Baolu Lu <baolu.lu@linux.intel.com>
To: Jean-Philippe Brucker <jean-philippe@linaro.org>
Cc: Joerg Roedel <joro@8bytes.org>, Jason Gunthorpe <jgg@nvidia.com>,
	Christoph Hellwig <hch@infradead.org>,
	Kevin Tian <kevin.tian@intel.com>,
	Ashok Raj <ashok.raj@intel.com>, Will Deacon <will@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>,
	Jean-Philippe Brucker <jean-philippe@linaro.com>,
	Eric Auger <eric.auger@redhat.com>, Liu Yi L <yi.l.liu@intel.com>,
	Jacob jun Pan <jacob.jun.pan@intel.com>,
	iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 11/12] iommu: Per-domain I/O page fault handling
Date: Fri, 29 Apr 2022 14:35:36 +0800	[thread overview]
Message-ID: <d8682159-508b-501b-3642-54c8155a356d@linux.intel.com> (raw)
In-Reply-To: <YmqrTGcHotvhhaT2@myrica>

On 2022/4/28 22:57, Jean-Philippe Brucker wrote:
> On Thu, Apr 21, 2022 at 01:21:20PM +0800, Lu Baolu wrote:
>>   static void iopf_handle_group(struct work_struct *work)
>>   {
>>   	struct iopf_group *group;
>> @@ -134,12 +78,23 @@ static void iopf_handle_group(struct work_struct *work)
>>   	group = container_of(work, struct iopf_group, work);
>>   
>>   	list_for_each_entry_safe(iopf, next, &group->faults, list) {
>> +		struct iommu_domain *domain;
>> +
>> +		domain = iommu_get_domain_for_dev_pasid_async(group->dev,
>> +				iopf->fault.prm.pasid);
> Reading the PCIe spec again (v6.0 10.4.1.1 PASID Usage), all faults within
> the group have the same PASID so we could move the domain fetch out of the
> loop. It does deviate from the old behavior, though, so we could change
> it later.

Perhaps we can add a pasid member in the struct iopf_group and do a
sanity check when a new iopf is added to the group? Here, we just fetch
the domain with group->pasid.

Best regards,
baolu

WARNING: multiple messages have this Message-ID (diff)
From: Baolu Lu <baolu.lu@linux.intel.com>
To: Jean-Philippe Brucker <jean-philippe@linaro.org>
Cc: Kevin Tian <kevin.tian@intel.com>,
	Ashok Raj <ashok.raj@intel.com>,
	Robin Murphy <robin.murphy@arm.com>,
	linux-kernel@vger.kernel.org,
	Christoph Hellwig <hch@infradead.org>,
	Jean-Philippe Brucker <jean-philippe@linaro.com>,
	iommu@lists.linux-foundation.org,
	Jacob jun Pan <jacob.jun.pan@intel.com>,
	Jason Gunthorpe <jgg@nvidia.com>, Will Deacon <will@kernel.org>
Subject: Re: [PATCH v4 11/12] iommu: Per-domain I/O page fault handling
Date: Fri, 29 Apr 2022 14:35:36 +0800	[thread overview]
Message-ID: <d8682159-508b-501b-3642-54c8155a356d@linux.intel.com> (raw)
In-Reply-To: <YmqrTGcHotvhhaT2@myrica>

On 2022/4/28 22:57, Jean-Philippe Brucker wrote:
> On Thu, Apr 21, 2022 at 01:21:20PM +0800, Lu Baolu wrote:
>>   static void iopf_handle_group(struct work_struct *work)
>>   {
>>   	struct iopf_group *group;
>> @@ -134,12 +78,23 @@ static void iopf_handle_group(struct work_struct *work)
>>   	group = container_of(work, struct iopf_group, work);
>>   
>>   	list_for_each_entry_safe(iopf, next, &group->faults, list) {
>> +		struct iommu_domain *domain;
>> +
>> +		domain = iommu_get_domain_for_dev_pasid_async(group->dev,
>> +				iopf->fault.prm.pasid);
> Reading the PCIe spec again (v6.0 10.4.1.1 PASID Usage), all faults within
> the group have the same PASID so we could move the domain fetch out of the
> loop. It does deviate from the old behavior, though, so we could change
> it later.

Perhaps we can add a pasid member in the struct iopf_group and do a
sanity check when a new iopf is added to the group? Here, we just fetch
the domain with group->pasid.

Best regards,
baolu
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

  reply	other threads:[~2022-04-29  6:35 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21  5:21 [PATCH v4 00/12] iommu: SVA and IOPF refactoring Lu Baolu
2022-04-21  5:21 ` Lu Baolu
2022-04-21  5:21 ` [PATCH v4 01/12] dmaengine: idxd: Separate user and kernel pasid enabling Lu Baolu
2022-04-21  5:21   ` Lu Baolu
2022-04-21  5:21 ` [PATCH v4 02/12] iommu: Add pasid_bits field in struct dev_iommu Lu Baolu
2022-04-21  5:21   ` Lu Baolu
2022-04-21  5:21 ` [PATCH v4 03/12] iommu: Add attach/detach_dev_pasid domain ops Lu Baolu
2022-04-21  5:21   ` Lu Baolu
2022-04-28 14:53   ` Jean-Philippe Brucker
2022-04-28 14:53     ` Jean-Philippe Brucker
2022-04-29  6:27     ` Baolu Lu
2022-04-29  6:27       ` Baolu Lu
2022-04-21  5:21 ` [PATCH v4 04/12] iommu/sva: Basic data structures for SVA Lu Baolu
2022-04-21  5:21   ` Lu Baolu
2022-04-21  5:21 ` [PATCH v4 05/12] iommu/vt-d: Remove SVM_FLAG_SUPERVISOR_MODE support Lu Baolu
2022-04-21  5:21   ` Lu Baolu
2022-04-21  5:21 ` [PATCH v4 06/12] iommu/vt-d: Add SVA domain support Lu Baolu
2022-04-21  5:21   ` Lu Baolu
2022-04-21  5:21 ` [PATCH v4 07/12] arm-smmu-v3/sva: " Lu Baolu
2022-04-21  5:21   ` Lu Baolu
2022-04-21  5:21 ` [PATCH v4 08/12] iommu/sva: Use attach/detach_pasid_dev in SVA interfaces Lu Baolu
2022-04-21  5:21   ` Lu Baolu
2022-04-21  5:21 ` [PATCH v4 09/12] iommu: Remove SVA related callbacks from iommu ops Lu Baolu
2022-04-21  5:21   ` Lu Baolu
2022-04-21  5:21 ` [PATCH v4 10/12] iommu: Prepare IOMMU domain for IOPF Lu Baolu
2022-04-21  5:21   ` Lu Baolu
2022-04-28 14:47   ` Jean-Philippe Brucker
2022-04-28 14:47     ` Jean-Philippe Brucker
2022-04-29  6:17     ` Baolu Lu
2022-04-29  6:17       ` Baolu Lu
2022-04-21  5:21 ` [PATCH v4 11/12] iommu: Per-domain I/O page fault handling Lu Baolu
2022-04-21  5:21   ` Lu Baolu
2022-04-28 14:57   ` Jean-Philippe Brucker
2022-04-28 14:57     ` Jean-Philippe Brucker
2022-04-29  6:35     ` Baolu Lu [this message]
2022-04-29  6:35       ` Baolu Lu
2022-04-21  5:21 ` [PATCH v4 12/12] iommu: Rename iommu-sva-lib.{c,h} Lu Baolu
2022-04-21  5:21   ` Lu Baolu

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=d8682159-508b-501b-3642-54c8155a356d@linux.intel.com \
    --to=baolu.lu@linux.intel.com \
    --cc=ashok.raj@intel.com \
    --cc=eric.auger@redhat.com \
    --cc=hch@infradead.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jacob.jun.pan@intel.com \
    --cc=jean-philippe@linaro.com \
    --cc=jean-philippe@linaro.org \
    --cc=jgg@nvidia.com \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robin.murphy@arm.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.