From: Jason Gunthorpe <jgg@nvidia.com>
To: Pranjal Shrivastava <praan@google.com>
Cc: Joerg Roedel <joro@8bytes.org>,
Lu Baolu <baolu.lu@linux.intel.com>,
Will Deacon <will@kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
Mostafa Saleh <smostafa@google.com>,
iommu@lists.linux.dev, Kunkun Jiang <jiangkunkun@huawei.com>
Subject: Re: [PATCH rc v3] iommu: Handle iommu faults for a bad iopf setup
Date: Thu, 15 Aug 2024 20:04:47 -0300 [thread overview]
Message-ID: <20240815230447.GT2032816@nvidia.com> (raw)
In-Reply-To: <20240815182423.446137-1-praan@google.com>
On Thu, Aug 15, 2024 at 06:24:23PM +0000, Pranjal Shrivastava wrote:
> The iommu_report_device_fault function was updated to return void while
> assuming that drivers only need to call iommu_report_device_fault() for
> reporting an iopf. This implementation causes following problems:
>
> 1. The drivers rely on the core code to call it's page_reponse,
> however, when a fault is received and no fault capable domain is
> attached / iopf_param is NULL, the ops->page_response is NOT called
> causing the device to stall in case the fault type was PAGE_REQ.
>
> 2. The arm_smmu_v3 driver relies on the returned value to log errors
> returning void from iommu_report_device_fault causes these events to
> be missed while logging.
>
> Modify the iommu_report_device_fault function to return -EINVAL for
> cases where no fault capable domain is attached or iopf_param was NULL
> and calls back to the driver (ops->page_response) in case the fault type
> was IOMMU_FAULT_PAGE_REQ. The returned value can be used by the drivers
> to log the fault/event as needed.
>
> Reported-by: Kunkun Jiang <jiangkunkun@huawei.com>
> Closes: https://lore.kernel.org/all/6147caf0-b9a0-30ca-795e-a1aa502a5c51@huawei.com/
> Fixes: 3dfa64aecbaf ("iommu: Make iommu_report_device_fault() return void")
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
> Signed-off-by: Pranjal Shrivastava <praan@google.com>
> ---
> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 2 +-
> drivers/iommu/io-pgfault.c | 116 +++++++++++++-------
> include/linux/iommu.h | 5 +-
> 3 files changed, 83 insertions(+), 40 deletions(-)
You can keep tags for minor changes like this:
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Jason
next prev parent reply other threads:[~2024-08-15 23:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-15 18:24 [PATCH rc v3] iommu: Handle iommu faults for a bad iopf setup Pranjal Shrivastava
2024-08-15 23:04 ` Jason Gunthorpe [this message]
2024-08-16 2:17 ` Baolu Lu
2024-08-16 7:10 ` Pranjal Shrivastava
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=20240815230447.GT2032816@nvidia.com \
--to=jgg@nvidia.com \
--cc=baolu.lu@linux.intel.com \
--cc=iommu@lists.linux.dev \
--cc=jiangkunkun@huawei.com \
--cc=joro@8bytes.org \
--cc=praan@google.com \
--cc=robin.murphy@arm.com \
--cc=smostafa@google.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 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.