From: Zhangfei Gao <zhangfei.gao@linaro.org>
To: Nicolin Chen <nicolinc@nvidia.com>
Cc: Shameer Kolothum <skolothumtho@nvidia.com>,
"qemu-arm@nongnu.org" <qemu-arm@nongnu.org>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"eric.auger@redhat.com" <eric.auger@redhat.com>,
"peter.maydell@linaro.org" <peter.maydell@linaro.org>,
Nathan Chen <nathanc@nvidia.com>, Matt Ochs <mochs@nvidia.com>,
"jonathan.cameron@huawei.com" <jonathan.cameron@huawei.com>,
"zhenzhong.duan@intel.com" <zhenzhong.duan@intel.com>,
Jason Gunthorpe <jgg@nvidia.com>,
Krishnakant Jaju <kjaju@nvidia.com>
Subject: Re: [RFC PATCH 4/4] hw/arm/smmuv3-accel: Read and propagate host vIOMMU events
Date: Fri, 14 Nov 2025 16:45:26 +0800 [thread overview]
Message-ID: <CABQgh9FYE6Jfm2iV7xGrydS5Yyk7L-VgArL4jOz=bCSdy5+HiQ@mail.gmail.com> (raw)
In-Reply-To: <aRYY5eBnlw46nt2f@Asurada-Nvidia>
On Fri, 14 Nov 2025 at 01:44, Nicolin Chen <nicolinc@nvidia.com> wrote:
>
> On Thu, Nov 13, 2025 at 05:07:50AM -0800, Shameer Kolothum wrote:
> > > On Wed, 5 Nov 2025 at 23:49, Shameer Kolothum
> > > <skolothumtho@nvidia.com> wrote:
> > > >
> > > > Install an event handler on the vEVENTQ fd to read and propagate host
> > > > generated vIOMMU events to the guest.
> > > >
> > > > The handler runs in QEMU’s main loop, using a non-blocking fd registered
> > > > via qemu_set_fd_handler().
> > > >
> > > > Signed-off-by: Shameer Kolothum <skolothumtho@nvidia.com>
> > >
> > > Still don't understand how to use this vevent.
> > > Is it to replace the fault queue (IOMMU_FAULT_QUEUE_ALLOC)?
> >
> > No. IIUC, IOMMU_FAULT_QUEUE_ALLOC is to handle I/O page faults
> > for any HWPT capable of handling page faults/response. The QEMU
> > SMMUv3 still don't support page fault handling.
> >
> > The VEVENTQ, on the other hand, provides a way to report any
> > other s1 events to Guest.
> >
> > See how events are reported in arm_smmu_handle_event():
> >
> > if (event->stall)
> > ret = iommu_report_device_fault(master->dev, &fault_evt); //Page faults
> > else if (master->vmaster && !event->s2)
> > ret = arm_vmaster_report_event(master->vmaster, evt); //This series handles this case.
> > else
> > ret = -EOPNOTSUPP;
>
> Yes. We can say that FAULT_QUEUE is exclusively for PRI while the
> vEVENTQ is for other types of HW events (or IRQs) related to the
> guest stage-1. They can be used together.
>
> > > And only find read, no write, only receive events but no response
> > > (from guest kernel)?
> >
> > Yes. And I am not sure what the long term plan is. We can still use
> > IOMMU_FAULT_QUEUE_ALLOC for page fault handling or extend this
> > VEVENTQ to have write() support for responses
> >
> > To me, from an implementation perspective, both this FAULT and
> > VEVENTQ look almost similar.
> >
> > @Nicolin, any idea what's plan for page fault handling?
>
> No. I think PRI should be done via FAULT_QUEUE.
Does that mean FAULT_QUEUE needs a response, so read + write
VEVENTQ only notify, no need response, only read.
page faults need FAULT_QUEUE to resume.
dirty page record in userspace for live-migration etc, just use VEVENTQ?
>
> > > By the way, can we use vevent in user space application? not in qemu
> > > environment.
> >
> > I didn't get that. Qemu is userspace. Or you meant just to receive any events
> > from host SMMUv3 in user spacel?
>
> If user space application follows the iommufd uAPI like QEMU does,
> it can. I am not sure about the use case though.
Thanks Nico.
>
> Nicolin
next prev parent reply other threads:[~2025-11-14 8:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-05 15:46 [RFC PATCH 0/4] vEVENTQ support for accelerated SMMUv3 devices Shameer Kolothum
2025-11-05 15:46 ` [RFC PATCH 1/4] backends/iommufd: Introduce iommufd_backend_alloc_veventq Shameer Kolothum
2025-11-05 15:46 ` [RFC PATCH 2/4] hw/arm/smmuv3-accel: Allocate vEVENTQ for accelerated SMMUv3 devices Shameer Kolothum
2025-11-05 15:46 ` [RFC PATCH 3/4] hw/arm/smmuv3: Introduce a helper function for event propagation Shameer Kolothum
2025-11-05 15:46 ` [RFC PATCH 4/4] hw/arm/smmuv3-accel: Read and propagate host vIOMMU events Shameer Kolothum
2025-11-11 13:29 ` Jonathan Cameron via
2025-11-13 11:59 ` Zhangfei Gao
2025-11-13 13:07 ` Shameer Kolothum
2025-11-13 17:44 ` Nicolin Chen
2025-11-14 8:45 ` Zhangfei Gao [this message]
2025-11-14 8:55 ` Shameer Kolothum
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='CABQgh9FYE6Jfm2iV7xGrydS5Yyk7L-VgArL4jOz=bCSdy5+HiQ@mail.gmail.com' \
--to=zhangfei.gao@linaro.org \
--cc=eric.auger@redhat.com \
--cc=jgg@nvidia.com \
--cc=jonathan.cameron@huawei.com \
--cc=kjaju@nvidia.com \
--cc=mochs@nvidia.com \
--cc=nathanc@nvidia.com \
--cc=nicolinc@nvidia.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=skolothumtho@nvidia.com \
--cc=zhenzhong.duan@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).