From: Baolu Lu <baolu.lu@linux.intel.com>
To: Jacob Pan <jacob.jun.pan@linux.intel.com>
Cc: baolu.lu@linux.intel.com, Joerg Roedel <joro@8bytes.org>,
Will Deacon <will@kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
Jason Gunthorpe <jgg@ziepe.ca>, Kevin Tian <kevin.tian@intel.com>,
Jean-Philippe Brucker <jean-philippe@linaro.org>,
Nicolin Chen <nicolinc@nvidia.com>, Yi Liu <yi.l.liu@intel.com>,
iommu@lists.linux.dev, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 9/9] iommu: Use fault cookie to store iopf_param
Date: Wed, 12 Jul 2023 11:13:08 +0800 [thread overview]
Message-ID: <e26db44c-ec72-085d-13ee-597237ba2134@linux.intel.com> (raw)
In-Reply-To: <20230711150249.62917dad@jacob-builder>
On 2023/7/12 6:02, Jacob Pan wrote:
> On Tue, 11 Jul 2023 09:06:42 +0800, Lu Baolu<baolu.lu@linux.intel.com>
> wrote:
>
>> Remove the static iopf_param pointer from struct iommu_fault_param to
>> save memory.
>>
>> Signed-off-by: Lu Baolu<baolu.lu@linux.intel.com>
>> ---
>> include/linux/iommu.h | 2 --
>> drivers/iommu/io-pgfault.c | 47 +++++++++++++++++++++++---------------
>> 2 files changed, 29 insertions(+), 20 deletions(-)
>>
>> diff --git a/include/linux/iommu.h b/include/linux/iommu.h
>> index ffd6fe1317f4..5fe37a7c5a55 100644
>> --- a/include/linux/iommu.h
>> +++ b/include/linux/iommu.h
>> @@ -551,7 +551,6 @@ struct iommu_fault_param {
>> * struct dev_iommu - Collection of per-device IOMMU data
>> *
>> * @fault_param: IOMMU detected device fault reporting data
>> - * @iopf_param: I/O Page Fault queue and data
>> * @fwspec: IOMMU fwspec data
>> * @iommu_dev: IOMMU device this device is linked to
>> * @priv: IOMMU Driver private data
>> @@ -564,7 +563,6 @@ struct iommu_fault_param {
>> struct dev_iommu {
>> struct mutex lock;
>> struct iommu_fault_param *fault_param;
>> - struct iopf_device_param *iopf_param;
>> struct iommu_fwspec *fwspec;
>> struct iommu_device *iommu_dev;
>> void *priv;
>> diff --git a/drivers/iommu/io-pgfault.c b/drivers/iommu/io-pgfault.c
>> index 1749e0869f2e..6a3a4e08e67e 100644
>> --- a/drivers/iommu/io-pgfault.c
>> +++ b/drivers/iommu/io-pgfault.c
>> @@ -158,7 +158,7 @@ int iommu_queue_iopf(struct iommu_fault *fault,
>> struct device *dev)
>> * As long as we're holding param->lock, the queue can't be
>> unlinked
>> * from the device and therefore cannot disappear.
>> */
>> - iopf_param = param->iopf_param;
>> + iopf_param = iommu_get_device_fault_cookie(dev, 0);
> I am not sure I understand how does it know the cookie type is iopf_param
> for PASID 0?
>
> Between IOPF and IOMMUFD use of the cookie, cookie types are different,
> right?
>
The fault cookie is managed by the code that delivers or handles the
faults. The sva and IOMMUFD paths are exclusive.
Best regards,
baolu
next prev parent reply other threads:[~2023-07-12 3:13 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-11 1:06 [PATCH 0/9] iommu: Prepare to deliver page faults to user space Lu Baolu
2023-07-11 1:06 ` [PATCH 1/9] iommu: Move iommu fault data to linux/iommu.h Lu Baolu
2023-07-11 6:05 ` Tian, Kevin
2023-07-12 2:07 ` Baolu Lu
2023-07-12 9:33 ` Jean-Philippe Brucker
2023-07-13 3:22 ` Tian, Kevin
2023-07-13 3:48 ` Baolu Lu
2023-07-11 1:06 ` [PATCH 2/9] iommu: Add device parameter to iopf handler Lu Baolu
2023-07-11 17:26 ` Jacob Pan
2023-07-12 2:16 ` Baolu Lu
2023-07-12 5:46 ` Jacob Pan
2023-07-11 1:06 ` [PATCH 3/9] iommu: Add common code to handle IO page faults Lu Baolu
2023-07-11 6:12 ` Tian, Kevin
2023-07-12 2:32 ` Baolu Lu
2023-07-12 9:45 ` Jean-Philippe Brucker
2023-07-13 4:02 ` Baolu Lu
2023-07-11 20:50 ` Jacob Pan
2023-07-12 2:37 ` Baolu Lu
2023-07-11 1:06 ` [PATCH 4/9] iommu: Change the return value of dev_iommu_get() Lu Baolu
2023-07-11 21:05 ` Jacob Pan
2023-07-11 1:06 ` [PATCH 5/9] iommu: Make fault_param generic Lu Baolu
2023-07-11 6:14 ` Tian, Kevin
2023-07-12 2:43 ` Baolu Lu
2023-07-11 21:31 ` Jacob Pan
2023-07-12 3:02 ` Baolu Lu
2023-07-11 1:06 ` [PATCH 6/9] iommu: Remove iommu_[un]register_device_fault_handler() Lu Baolu
2023-07-11 1:06 ` [PATCH 7/9] iommu: Add helper to set iopf handler for domain Lu Baolu
2023-07-11 1:06 ` [PATCH 8/9] iommu: Add iommu page fault cookie helpers Lu Baolu
2023-07-11 1:06 ` [PATCH 9/9] iommu: Use fault cookie to store iopf_param Lu Baolu
2023-07-11 6:26 ` Tian, Kevin
2023-07-12 3:09 ` Baolu Lu
2023-07-11 22:02 ` Jacob Pan
2023-07-12 3:13 ` Baolu Lu [this message]
2023-07-13 3:24 ` Tian, Kevin
2023-07-13 3:43 ` Baolu Lu
2023-07-13 8:01 ` Tian, Kevin
2023-07-14 2:49 ` Baolu Lu
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=e26db44c-ec72-085d-13ee-597237ba2134@linux.intel.com \
--to=baolu.lu@linux.intel.com \
--cc=iommu@lists.linux.dev \
--cc=jacob.jun.pan@linux.intel.com \
--cc=jean-philippe@linaro.org \
--cc=jgg@ziepe.ca \
--cc=joro@8bytes.org \
--cc=kevin.tian@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nicolinc@nvidia.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox