Linux IOMMU Development
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Yi Liu <yi.l.liu@intel.com>
Cc: joro@8bytes.org, kevin.tian@intel.com, baolu.lu@linux.intel.com,
	eric.auger@redhat.com, nicolinc@nvidia.com,
	chao.p.peng@linux.intel.com, iommu@lists.linux.dev,
	vasant.hegde@amd.com, will@kernel.org
Subject: Re: [PATCH] iommufd: Deal with IOMMU_HWPT_FAULT_ID_VALID in iommufd core
Date: Wed, 11 Dec 2024 16:02:31 -0400	[thread overview]
Message-ID: <20241211200231.GQ2347147@nvidia.com> (raw)
In-Reply-To: <20241207120108.5640-1-yi.l.liu@intel.com>

On Sat, Dec 07, 2024 at 04:01:08AM -0800, Yi Liu wrote:
> IOMMU_HWPT_FAULT_ID_VALID is used to mark if the fault_id field of
> iommu_hwp_alloc is valid or not. As the fault_id field is handled in
> the iommufd core, so it makes sense to sanitize the
> IOMMU_HWPT_FAULT_ID_VALID flag in the iommufd core, and mask it out
> before passing the user flags to the iommu drivers.
> 
> Signed-off-by: Yi Liu <yi.l.liu@intel.com>
> ---
>  drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c |  8 +-------
>  drivers/iommu/intel/iommu.c                         |  3 +--
>  drivers/iommu/iommufd/hw_pagetable.c                | 10 +++++++---
>  drivers/iommu/iommufd/selftest.c                    |  2 +-
>  4 files changed, 10 insertions(+), 13 deletions(-)

I'm going to take this, but there is still something missing - drivers
do not check domain->iopf_handler during attach and will happily
install these domains without any HW support for fault reporting.

Not sure this is so great.. I suggest adding a flag to the iommu_ops
'supports_fault_reporting', as just a global flag if the driver could
*possibly* support this. Core code will fail attach (and maybe alloc?)
if it is not set. If it is set driver must check domain->iopf_handler
during attach against HW capability.

Jason

  parent reply	other threads:[~2024-12-11 20:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-07 12:01 [PATCH] iommufd: Deal with IOMMU_HWPT_FAULT_ID_VALID in iommufd core Yi Liu
2024-12-09  1:08 ` Baolu Lu
2024-12-09  2:51   ` Yi Liu
2024-12-09 15:05     ` Jason Gunthorpe
2024-12-10  5:52       ` Yi Liu
2024-12-10 13:57         ` Jason Gunthorpe
2024-12-11  8:58         ` Tian, Kevin
2024-12-11  9:16           ` Yi Liu
2024-12-11  8:59 ` Tian, Kevin
2024-12-11 20:02 ` Jason Gunthorpe [this message]
2024-12-12  2:22   ` Yi Liu

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=20241211200231.GQ2347147@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=chao.p.peng@linux.intel.com \
    --cc=eric.auger@redhat.com \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=nicolinc@nvidia.com \
    --cc=vasant.hegde@amd.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