From: Baolu Lu <baolu.lu@linux.intel.com>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: baolu.lu@linux.intel.com, Joerg Roedel <joro@8bytes.org>,
Will Deacon <will@kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
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>,
Jacob Pan <jacob.jun.pan@linux.intel.com>,
Longfang Liu <liulongfang@huawei.com>,
Yan Zhao <yan.y.zhao@intel.com>,
iommu@lists.linux.dev, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v9 14/14] iommu: Track iopf group instead of last fault
Date: Tue, 9 Jan 2024 13:55:59 +0800 [thread overview]
Message-ID: <ca74243f-d1d1-4b01-95a6-58b4c85842d9@linux.intel.com> (raw)
In-Reply-To: <20240105175339.GI50608@ziepe.ca>
On 1/6/24 1:53 AM, Jason Gunthorpe wrote:
> On Wed, Dec 20, 2023 at 09:23:32AM +0800, Lu Baolu wrote:
>> /**
>> - * iommu_handle_iopf - IO Page Fault handler
>> - * @fault: fault event
>> - * @iopf_param: the fault parameter of the device.
>> + * iommu_report_device_fault() - Report fault event to device driver
>> + * @dev: the device
>> + * @evt: fault event data
>> *
>> - * Add a fault to the device workqueue, to be handled by mm.
>> + * Called by IOMMU drivers when a fault is detected, typically in a threaded IRQ
>> + * handler. When this function fails and the fault is recoverable, it is the
>> + * caller's responsibility to complete the fault.
> This patch seems OK for what it does so:
>
> Reviewed-by: Jason Gunthorpe<jgg@nvidia.com>
>
> However, this seems like a strange design, surely this function should
> just call ops->page_response() when it can't enqueue the fault?
>
> It is much cleaner that way, so maybe you can take this into a
> following patch (along with the driver fixes to accomodate. (and
> perhaps iommu_report_device_fault() should return void too)
>
> Also iopf_group_response() should return void (another patch!),
> nothing can do anything with the failure. This implies that
> ops->page_response() must also return void - which is consistent with
> what the drivers do, the failure paths are all integrity validations
> of the fault and should be WARN_ON'd not return codes.
Make sense. I will integrate the code in the next version and convert
iommu_report_device_fault() to return void.
Best regards,
baolu
prev parent reply other threads:[~2024-01-09 6:01 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-20 1:23 [PATCH v9 00/14] iommu: Prepare to deliver page faults to user space Lu Baolu
2023-12-20 1:23 ` [PATCH v9 01/14] iommu: Move iommu fault data to linux/iommu.h Lu Baolu
2023-12-20 1:23 ` [PATCH v9 02/14] iommu/arm-smmu-v3: Remove unrecoverable faults reporting Lu Baolu
2023-12-20 1:23 ` [PATCH v9 03/14] iommu: Remove unrecoverable fault data Lu Baolu
2023-12-20 1:23 ` [PATCH v9 04/14] iommu: Cleanup iopf data structure definitions Lu Baolu
2023-12-20 1:23 ` [PATCH v9 05/14] iommu: Merge iopf_device_param into iommu_fault_param Lu Baolu
2023-12-20 1:23 ` [PATCH v9 06/14] iommu: Remove iommu_[un]register_device_fault_handler() Lu Baolu
2023-12-20 1:23 ` [PATCH v9 07/14] iommu: Merge iommu_fault_event and iopf_fault Lu Baolu
2023-12-20 1:23 ` [PATCH v9 08/14] iommu: Prepare for separating SVA and IOPF Lu Baolu
2023-12-20 1:23 ` [PATCH v9 09/14] iommu: Make iommu_queue_iopf() more generic Lu Baolu
2023-12-20 1:23 ` [PATCH v9 10/14] iommu: Separate SVA and IOPF Lu Baolu
2023-12-20 1:23 ` [PATCH v9 11/14] iommu: Refine locking for per-device fault data management Lu Baolu
2023-12-20 1:23 ` [PATCH v9 12/14] iommu: Use refcount for fault data access Lu Baolu
2024-01-05 16:09 ` Jason Gunthorpe
2024-01-09 2:47 ` Baolu Lu
2023-12-20 1:23 ` [PATCH v9 13/14] iommu: Improve iopf_queue_remove_device() Lu Baolu
2024-01-05 16:25 ` Jason Gunthorpe
2024-01-09 3:36 ` Baolu Lu
2023-12-20 1:23 ` [PATCH v9 14/14] iommu: Track iopf group instead of last fault Lu Baolu
2024-01-05 17:53 ` Jason Gunthorpe
2024-01-09 5:55 ` 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=ca74243f-d1d1-4b01-95a6-58b4c85842d9@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