From: Baolu Lu <baolu.lu@linux.intel.com>
To: liulongfang <liulongfang@huawei.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>
Cc: baolu.lu@linux.intel.com, Yi Liu <yi.l.liu@intel.com>,
Jacob Pan <jacob.jun.pan@linux.intel.com>,
Yan Zhao <yan.y.zhao@intel.com>,
iommu@lists.linux.dev, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v7 00/12] iommu: Prepare to deliver page faults to user space
Date: Fri, 24 Nov 2023 20:01:45 +0800 [thread overview]
Message-ID: <7a683525-07ca-4ff1-97bd-0193d07dc857@linux.intel.com> (raw)
In-Reply-To: <1a029033-3c9e-aeab-06bf-1e7020c2bc7d@huawei.com>
On 2023/11/24 14:30, liulongfang wrote:
> On 2023/11/15 11:02, Lu Baolu Wrote:
>> When a user-managed page table is attached to an IOMMU, it is necessary
>> to deliver IO page faults to user space so that they can be handled
>> appropriately. One use case for this is nested translation, which is
>> currently being discussed in the mailing list.
>>
>> I have posted a RFC series [1] that describes the implementation of
>> delivering page faults to user space through IOMMUFD. This series has
>> received several comments on the IOMMU refactoring, which I am trying to
>> address in this series.
>>
>> The major refactoring includes:
>>
>> - [PATCH 01 ~ 04] Move include/uapi/linux/iommu.h to
>> include/linux/iommu.h. Remove the unrecoverable fault data definition.
>> - [PATCH 05 ~ 06] Remove iommu_[un]register_device_fault_handler().
>> - [PATCH 07 ~ 10] Separate SVA and IOPF. Make IOPF a generic page fault
>> handling framework.
>> - [PATCH 11 ~ 12] Improve iopf framework for iommufd use.
>>
>> This is also available at github [2].
>>
>> [1] https://lore.kernel.org/linux-iommu/20230530053724.232765-1-baolu.lu@linux.intel.com/
>> [2] https://github.com/LuBaolu/intel-iommu/commits/preparatory-io-pgfault-delivery-v7
>>
>> Change log:
>> v7:
>> - Rebase to v6.7-rc1.
>> - Export iopf_group_response() for global use.
>> - Release lock when calling iopf handler.
>> - The whole series has been verified to work for SVA case on Intel
>> platforms by Zhao Yan. Add her Tested-by to affected patches.
>>
>> v6: https://lore.kernel.org/linux-iommu/20230928042734.16134-1-baolu.lu@linux.intel.com/
>> - [PATCH 09/12] Check IS_ERR() against the iommu domain. [Jingqi/Jason]
>> - [PATCH 12/12] Rename the comments and name of iopf_queue_flush_dev(),
>> no functionality changes. [Kevin]
>> - All patches rebased on the latest iommu/core branch.
>>
>> v5: https://lore.kernel.org/linux-iommu/20230914085638.17307-1-baolu.lu@linux.intel.com/
>> - Consolidate per-device fault data management. (New patch 11)
>> - Improve iopf_queue_flush_dev(). (New patch 12)
>>
>> v4: https://lore.kernel.org/linux-iommu/20230825023026.132919-1-baolu.lu@linux.intel.com/
>> - Merge iommu_fault_event and iopf_fault. They are duplicate.
>> - Move iommu_report_device_fault() and iommu_page_response() to
>> io-pgfault.c.
>> - Move iommu_sva_domain_alloc() to iommu-sva.c.
>> - Add group->domain and use it directly in sva fault handler.
>> - Misc code refactoring and refining.
>>
>> v3: https://lore.kernel.org/linux-iommu/20230817234047.195194-1-baolu.lu@linux.intel.com/
>> - Convert the fault data structures from uAPI to kAPI.
>> - Merge iopf_device_param into iommu_fault_param.
>> - Add debugging on domain lifetime for iopf.
>> - Remove patch "iommu: Change the return value of dev_iommu_get()".
>> - Remove patch "iommu: Add helper to set iopf handler for domain".
>> - Misc code refactoring and refining.
>>
>> v2: https://lore.kernel.org/linux-iommu/20230727054837.147050-1-baolu.lu@linux.intel.com/
>> - Remove unrecoverable fault data definition as suggested by Kevin.
>> - Drop the per-device fault cookie code considering that doesn't make
>> much sense for SVA.
>> - Make the IOMMU page fault handling framework generic. So that it can
>> available for use cases other than SVA.
>>
>> v1: https://lore.kernel.org/linux-iommu/20230711010642.19707-1-baolu.lu@linux.intel.com/
>>
>> Lu Baolu (12):
>> iommu: Move iommu fault data to linux/iommu.h
>> iommu/arm-smmu-v3: Remove unrecoverable faults reporting
>> iommu: Remove unrecoverable fault data
>> iommu: Cleanup iopf data structure definitions
>> iommu: Merge iopf_device_param into iommu_fault_param
>> iommu: Remove iommu_[un]register_device_fault_handler()
>> iommu: Merge iommu_fault_event and iopf_fault
>> iommu: Prepare for separating SVA and IOPF
>> iommu: Make iommu_queue_iopf() more generic
>> iommu: Separate SVA and IOPF
>> iommu: Consolidate per-device fault data management
>> iommu: Improve iopf_queue_flush_dev()
>>
>> include/linux/iommu.h | 266 +++++++---
>> drivers/iommu/intel/iommu.h | 2 +-
>> drivers/iommu/iommu-sva.h | 71 ---
>> include/uapi/linux/iommu.h | 161 ------
>> .../iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c | 14 +-
>> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 51 +-
>> drivers/iommu/intel/iommu.c | 25 +-
>> drivers/iommu/intel/svm.c | 8 +-
>> drivers/iommu/io-pgfault.c | 469 ++++++++++++------
>> drivers/iommu/iommu-sva.c | 66 ++-
>> drivers/iommu/iommu.c | 232 ---------
>> MAINTAINERS | 1 -
>> drivers/iommu/Kconfig | 4 +
>> drivers/iommu/Makefile | 3 +-
>> drivers/iommu/intel/Kconfig | 1 +
>> 15 files changed, 601 insertions(+), 773 deletions(-)
>> delete mode 100644 drivers/iommu/iommu-sva.h
>> delete mode 100644 include/uapi/linux/iommu.h
>>
>
> Tested-By: Longfang Liu <liulongfang@huawei.com>
Thank you for the testing.
>
> The Arm SVA mode based on HiSilicon crypto accelerator completed the functional test
> and performance test of page fault scenarios.
> 1. The IOMMU page fault processing function is normal.
> 2. Performance test on 128 core ARM platform. performance is reduced:
>
> Threads Performance
> 8 -0.77%
> 16 -1.1%
> 32 -0.31%
> 64 -0.49%
> 128 -0.72%
> 256 -1.7%
> 384 -4.94%
> 512 NA(iopf timeout)
>
> Finally, continuing to increase the number of threads will cause iommu's page fault
> processing to time out(more than 4.2 seconds).
> This problem occurs both in the before version(kernel6.7-rc1) and
> in the after modification's version.
Probably you can check whether commit 6bbd42e2df8f ("mmu_notifiers: call
invalidate_range() when invalidating TLBs") matters.
It was discussed in this thread.
https://lore.kernel.org/linux-iommu/20231117090933.75267-1-baolu.lu@linux.intel.com/
Best regards,
baolu
next prev parent reply other threads:[~2023-11-24 12:01 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-15 3:02 [PATCH v7 00/12] iommu: Prepare to deliver page faults to user space Lu Baolu
2023-11-15 3:02 ` [PATCH v7 01/12] iommu: Move iommu fault data to linux/iommu.h Lu Baolu
2023-12-04 10:52 ` Yi Liu
2023-11-15 3:02 ` [PATCH v7 02/12] iommu/arm-smmu-v3: Remove unrecoverable faults reporting Lu Baolu
2023-12-01 15:42 ` Jason Gunthorpe
2023-12-04 10:54 ` Yi Liu
2023-12-05 11:48 ` Baolu Lu
2023-11-15 3:02 ` [PATCH v7 03/12] iommu: Remove unrecoverable fault data Lu Baolu
2023-12-04 10:58 ` Yi Liu
2023-12-05 11:55 ` Baolu Lu
2023-11-15 3:02 ` [PATCH v7 04/12] iommu: Cleanup iopf data structure definitions Lu Baolu
2023-12-04 11:03 ` Yi Liu
2023-11-15 3:02 ` [PATCH v7 05/12] iommu: Merge iopf_device_param into iommu_fault_param Lu Baolu
2023-12-04 12:32 ` Yi Liu
2023-12-05 12:01 ` Baolu Lu
2023-11-15 3:02 ` [PATCH v7 06/12] iommu: Remove iommu_[un]register_device_fault_handler() Lu Baolu
2023-12-04 12:36 ` Yi Liu
2023-12-05 12:09 ` Baolu Lu
2023-11-15 3:02 ` [PATCH v7 07/12] iommu: Merge iommu_fault_event and iopf_fault Lu Baolu
2023-12-01 19:09 ` Jason Gunthorpe
2023-12-04 12:40 ` Yi Liu
2023-11-15 3:02 ` [PATCH v7 08/12] iommu: Prepare for separating SVA and IOPF Lu Baolu
2023-12-05 7:10 ` Yi Liu
2023-11-15 3:02 ` [PATCH v7 09/12] iommu: Make iommu_queue_iopf() more generic Lu Baolu
2023-12-01 19:14 ` Jason Gunthorpe
2023-12-05 7:13 ` Yi Liu
2023-12-05 12:13 ` Baolu Lu
2023-11-15 3:02 ` [PATCH v7 10/12] iommu: Separate SVA and IOPF Lu Baolu
2023-11-15 3:02 ` [PATCH v7 11/12] iommu: Consolidate per-device fault data management Lu Baolu
2023-12-01 19:46 ` Jason Gunthorpe
2023-12-04 0:58 ` Baolu Lu
2023-11-15 3:02 ` [PATCH v7 12/12] iommu: Improve iopf_queue_flush_dev() Lu Baolu
2023-12-01 20:35 ` Jason Gunthorpe
2023-12-03 8:53 ` Baolu Lu
2023-12-03 14:14 ` Jason Gunthorpe
2023-12-04 1:32 ` Baolu Lu
2023-12-04 5:37 ` Tian, Kevin
2023-12-04 13:25 ` Jason Gunthorpe
2023-12-05 1:32 ` Tian, Kevin
2023-12-05 1:53 ` Jason Gunthorpe
2023-12-05 3:23 ` Tian, Kevin
2023-12-05 15:52 ` Jason Gunthorpe
2023-12-04 13:12 ` Jason Gunthorpe
2023-12-04 3:46 ` Baolu Lu
2023-12-04 13:27 ` Jason Gunthorpe
2023-12-05 1:13 ` Baolu Lu
2023-11-24 6:30 ` [PATCH v7 00/12] iommu: Prepare to deliver page faults to user space liulongfang
2023-11-24 12:01 ` Baolu Lu [this message]
2023-11-25 4:05 ` liulongfang
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=7a683525-07ca-4ff1-97bd-0193d07dc857@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=liulongfang@huawei.com \
--cc=nicolinc@nvidia.com \
--cc=robin.murphy@arm.com \
--cc=will@kernel.org \
--cc=yan.y.zhao@intel.com \
--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