From: Jason Gunthorpe <jgg@nvidia.com>
To: Yi Liu <yi.l.liu@intel.com>
Cc: Baolu Lu <baolu.lu@linux.intel.com>,
joro@8bytes.org, kevin.tian@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: Mon, 9 Dec 2024 11:05:14 -0400 [thread overview]
Message-ID: <20241209150514.GD2347147@nvidia.com> (raw)
In-Reply-To: <3f9e3172-dffb-449d-8bd5-23f9cb2de73a@intel.com>
On Mon, Dec 09, 2024 at 10:51:51AM +0800, Yi Liu wrote:
> On 2024/12/9 09:08, Baolu Lu wrote:
> > On 12/7/24 20:01, 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.
> >
> > Is it a valid use case for an iommu driver to intercept the
> > IOMMU_HWPT_FAULT_ID_VALID flag as an indication that user space requests
> > an iopf-capable domain?
For now we have no use case, so we can drop it from drivers, I think.
PRI support or not is decided when the domain is attached based on the
fault_handler in the struct iommu_domain.
As a general rule drivers should not know the *userspace* is doing
something as much as we can manage.
> > If the device and its associated iommu do not support PRI, the domain
> > allocation should be aborted and a failure returned?
> Agreed, it is better to fail the hwpt allocation. BTW. We may also check it
> by reading the enable bit in PCI config space of the device. Which one
> would be better?
We should not be reading pci config space in iommufd. iommufd is
generic and not tied to PCI.
It would be nice if domain allocation fails, but also I wouldn't
contort things to achieve that. Failing attach is also OK and must
also be supported as a fault capable domain allocated on a fault
capable device can still fail to be attached to a non fault capable
device.
"fault capable" is complicated unfortunately because we have driver
specific page fault reporting, and it may be that vfio userspace is
processing fault...
Jason
next prev parent reply other threads:[~2024-12-09 15:05 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 [this message]
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
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=20241209150514.GD2347147@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 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.