From: Nicolin Chen <nicolinc@nvidia.com>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Lu Baolu <baolu.lu@linux.intel.com>,
Kevin Tian <kevin.tian@intel.com>, Joerg Roedel <joro@8bytes.org>,
Will Deacon <will@kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
Jean-Philippe Brucker <jean-philippe@linaro.org>,
"Yi Liu" <yi.l.liu@intel.com>,
Jacob Pan <jacob.jun.pan@linux.intel.com>,
"Joel Granados" <j.granados@samsung.com>, <iommu@lists.linux.dev>,
<virtualization@lists.linux-foundation.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v8 06/10] iommufd: Add iommufd fault object
Date: Mon, 8 Jul 2024 11:36:57 -0700 [thread overview]
Message-ID: <ZowxyUQAcqDJ4yZ6@Asurada-Nvidia> (raw)
In-Reply-To: <20240708162957.GB14050@ziepe.ca>
On Mon, Jul 08, 2024 at 01:29:57PM -0300, Jason Gunthorpe wrote:
> On Wed, Jul 03, 2024 at 04:06:15PM -0700, Nicolin Chen wrote:
>
> > I learned that this hwpt->fault is exclusively for IOPF/PRI. And
> > Jason suggested me to add a different one for VIOMMU. Yet, after
> > taking a closer look, I found the fault object in this series is
> > seemingly quite generic at the uAPI level: its naming/structure,
> > and the way how it's allocated and passed to hwpt, despite being
> > highly correlated with IOPF in its fops code. So, I feel that we
> > might have a chance of reusing it for different fault types:
> >
> > +enum iommu_fault_type {
> > + IOMMU_FAULT_TYPE_HWPT_IOPF,
> > + IOMMU_FAULT_TYPE_VIOMMU_IRQ,
> > +};
> >
> > struct iommu_fault_alloc {
> > __u32 size;
> > __u32 flags;
> > + __u32 type; /* enum iommu_fault_type */
> > __u32 out_fault_id;
> > __u32 out_fault_fd;
> > };
>
> I think I would just add the type at the end of the struct and rely on
> our existing 0 is backwards compat mechanism. 0 means HWPT_IOPF. ie no
> need to do anything now.
Yea, I figured that it would work too, so let's add one in the
VIOMMU series (if we eventually decide to reuse the same ioctl).
> It would make some sense to call this a "report" object than "fault"
> if we are going to use it for different things. We could probably
> rename it without much trouble. There is also not a significant issue
> with having two alloc commands for FDs.
Ack.
> I'd also think VIOMMU_IRQ is probably not that right abstraction,
> likely it makes more sense to push driver-specific event messages sort
> of like IOPF and one of the messages can indicate a arm-smmu-v3 VCDMQ
> interrupt, other messages could indicate BAD_CD and similar sorts of
> events we might want to capture and forward.
Maybe something like this?
struct iommu_viommu_event_arm_smmuv3 {
u64 evt[4];
};
struct iommu_viommu_event_tegra241_cmdqv {
u64 vcmdq_err_map[2];
};
enum iommu_event_type {
IOMMM_HWPT_EVENT_TYPE_IOPF,
IOMMU_VIOMMU_EVENT_TYPE_SMMUv3,
IOMMU_VIOMMU_EVENT_TYPE_TEGRA241_CMDQV,
};
struct iommu_event_alloc {
__u32 size;
__u32 flags;
__u32 out_event_id;
__u32 out_event_fd;
__u32 type;
__u32 _reserved;
};
It can be "report" if you prefer.
Thanks
Nicolin
next prev parent reply other threads:[~2024-07-08 18:37 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-02 6:34 [PATCH v8 00/10] IOMMUFD: Deliver IO page faults to user space Lu Baolu
2024-07-02 6:34 ` [PATCH v8 01/10] iommu: Introduce domain attachment handle Lu Baolu
2024-07-02 6:34 ` [PATCH v8 02/10] iommu: Remove sva handle list Lu Baolu
2024-07-02 6:34 ` [PATCH v8 03/10] iommu: Add attach handle to struct iopf_group Lu Baolu
2024-07-02 6:34 ` [PATCH v8 04/10] iommu: Extend domain attach group with handle support Lu Baolu
2024-07-02 6:34 ` [PATCH v8 05/10] iommufd: Add fault and response message definitions Lu Baolu
2024-07-02 6:34 ` [PATCH v8 06/10] iommufd: Add iommufd fault object Lu Baolu
2024-07-03 23:06 ` Nicolin Chen
2024-07-04 2:59 ` Baolu Lu
2024-07-04 5:36 ` Nicolin Chen
2024-07-04 6:37 ` Tian, Kevin
2024-07-04 7:32 ` Baolu Lu
2024-07-04 23:18 ` Nicolin Chen
2024-07-05 0:49 ` Tian, Kevin
2024-07-08 16:22 ` Jason Gunthorpe
2024-07-08 16:29 ` Jason Gunthorpe
2024-07-08 18:36 ` Nicolin Chen [this message]
2024-07-09 17:00 ` Jason Gunthorpe
2024-07-09 17:33 ` Nicolin Chen
2024-07-12 13:00 ` Jason Gunthorpe
2024-07-02 6:34 ` [PATCH v8 07/10] iommufd: Fault-capable hwpt attach/detach/replace Lu Baolu
2024-10-15 3:19 ` Zhangfei Gao
2024-10-15 12:54 ` Jason Gunthorpe
2024-10-16 1:58 ` Zhangfei Gao
2024-10-16 15:25 ` Jason Gunthorpe
2024-10-17 1:44 ` Zhangfei Gao
2024-10-17 12:05 ` Jason Gunthorpe
2024-10-17 12:35 ` Zhangfei Gao
2024-10-17 12:58 ` Shameerali Kolothum Thodi
2024-10-17 13:08 ` Jason Gunthorpe
2024-10-18 1:58 ` Baolu Lu
2024-10-18 2:45 ` Zhangfei Gao
2024-10-27 14:12 ` Zhangfei Gao
2024-10-27 14:26 ` Baolu Lu
2024-10-28 9:56 ` Zhangfei Gao
2024-10-28 11:17 ` Baolu Lu
2024-10-18 14:33 ` Jason Gunthorpe
2024-10-18 13:53 ` Jason Gunthorpe
2024-10-22 14:30 ` Zhangfei Gao
2024-10-22 14:52 ` Jason Gunthorpe
2024-10-23 10:22 ` Zhangfei Gao
2024-07-02 6:34 ` [PATCH v8 08/10] iommufd: Associate fault object with iommufd_hw_pgtable Lu Baolu
2024-07-02 6:34 ` [PATCH v8 09/10] iommufd/selftest: Add IOPF support for mock device Lu Baolu
2024-07-02 6:34 ` [PATCH v8 10/10] iommufd/selftest: Add coverage for IOPF test Lu Baolu
2024-07-04 14:18 ` [PATCH v8 00/10] IOMMUFD: Deliver IO page faults to user space Will Deacon
2024-07-09 17:23 ` Jason Gunthorpe
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=ZowxyUQAcqDJ4yZ6@Asurada-Nvidia \
--to=nicolinc@nvidia.com \
--cc=baolu.lu@linux.intel.com \
--cc=iommu@lists.linux.dev \
--cc=j.granados@samsung.com \
--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=linux-kernel@vger.kernel.org \
--cc=robin.murphy@arm.com \
--cc=virtualization@lists.linux-foundation.org \
--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;
as well as URLs for NNTP newsgroup(s).