From: Baolu Lu <baolu.lu@linux.intel.com>
To: "Tian, Kevin" <kevin.tian@intel.com>,
"iommu@lists.linux.dev" <iommu@lists.linux.dev>
Cc: baolu.lu@linux.intel.com, Joerg Roedel <joro@8bytes.org>,
Will Deacon <will@kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/1] iommu/vt-d: Make SVA and IOPF irrelevant
Date: Mon, 12 Sep 2022 15:01:47 +0800 [thread overview]
Message-ID: <5a11d688-9245-9041-5183-3eb87914eb1f@linux.intel.com> (raw)
In-Reply-To: <BN9PR11MB5276307EAF55B4EE8AB71E278C439@BN9PR11MB5276.namprd11.prod.outlook.com>
On 2022/9/9 16:33, Tian, Kevin wrote:
>> From: Lu Baolu <baolu.lu@linux.intel.com>
>> Sent: Thursday, September 8, 2022 10:36 AM
>>
>> The existing IOPF handling code relies on the per-PASID SVA data
>> structures. It does not apply to scenarios other than SVA. This
>> decouples the I/O page fault reporting and responding code from
>> SVA related data structures so that the PRQ handling code could
>> become generic.
>
> I think the point is that it's unnecessary to access those SVA data
> in the fault path. otherwise 'decouple' reads like an alternative
> implementation is added instead of just removing the code.
Makes sense. I will rephrase the commit message like this:
iommu/vt-d: Remove unnecessary SVA data accesses in page fault path
The existing I/O page fault handling code accesses the per-PASID SVA data
structures. This is unnecessary and makes the fault handling code only
suitable for SVA scenarios. This removes the SVA data accesses from the
I/O page fault reporting and responding code, so that the fault handling
code could be generic.
>
> Overall this is a nice cleanup, but a few nits here:
>
>> - /*
>> - * If prq is to be handled outside iommu driver via receiver of
>> - * the fault notifiers, we skip the page response here.
>> - */
>
> I didn't understand what this comment is trying to say. But just want
> to confirm removing it is the desired thing given the original code below
> it is still kept below...
I carelessly removed this comment. Yes. It still makes sense. I will add
it back.
>
>> - if (intel_svm_prq_report(iommu, sdev->dev, req))
>> + pdev = pci_get_domain_bus_and_slot(iommu->segment,
>> + PCI_BUS_NUM(req->rid),
>> + req->rid & 0xff);
>> + if (!pdev || intel_svm_prq_report(iommu, &pdev->dev, req))
>> handle_bad_prq_event(iommu, req,
>> QI_RESP_INVALID);
>>
>> - trace_prq_report(iommu, sdev->dev, req->qw_0, req->qw_1,
>> + trace_prq_report(iommu, &pdev->dev, req->qw_0, req-
>>> qw_1,
>> req->priv_data[0], req->priv_data[1],
>> - sdev->prq_seq_number);
>> + prq_seq_number++);
>
> Previously this is counted per device but now becomes global. Could it
> be stored elsewhere in a per-device structure?
I think the per-IOMMU structure might be the right place to store it.
Those faults share a page fault queue.
Best regards,
baolu
prev parent reply other threads:[~2022-09-12 7:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-08 2:35 [PATCH 1/1] iommu/vt-d: Make SVA and IOPF irrelevant Lu Baolu
2022-09-09 8:33 ` Tian, Kevin
2022-09-12 7:01 ` Baolu Lu [this message]
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=5a11d688-9245-9041-5183-3eb87914eb1f@linux.intel.com \
--to=baolu.lu@linux.intel.com \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=kevin.tian@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=robin.murphy@arm.com \
--cc=will@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox