From: Peter Xu <peterx@redhat.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [PATCH] hw/intc/ioapic: Update KVM routes before redelivering IRQ, on RTE update
Date: Fri, 10 Mar 2023 15:13:11 -0500 [thread overview]
Message-ID: <ZAuPV0kTb0ruFihj@x1n> (raw)
In-Reply-To: <e8d8950b45cf35f16f3e9d3af979af1ea2ccead6.camel@infradead.org>
On Fri, Mar 10, 2023 at 05:52:57PM +0000, David Woodhouse wrote:
> On Thu, 2023-03-09 at 11:55 -0500, Peter Xu wrote:
> >
> > There're four devices that can hook onto this, IIUC. Besides IOAPIC and
> > VFIO, there's also ivshmem and vhost. IIUC we'll need to change all the
> > four devices to implement this.
>
> If you grep for kvm_irqchip_add_irqfd_notifier() there are more than that.
Looks right to me. I assume they're all line based IRQs routed later to
IOAPIC, so they're the real devices consuming the IOAPIC entries.
> There's a bunch of largely duplicated code, with different code paths
> for kvm_irqfds_enabled() and other variants. In code that I don't think
> should even have to *know* about KVM, should it?
>
> I think I'd like to provide a generic set of helpers which just allow
> callers to register a virtual IRQ and then trigger it manually and/or
> attach an irqfd (and a resamplefd, qv) to it.
>
> This new helper code can then cope with listening in userspace on that
> fd if/when it needs to, and can even work for the non-KVM case. The
> actual devices get a *lot* simpler.
>
> It'll *broadly* look like the existing kvm_irqchip_* functions but be a
> lot simpler to use.
IIUC what's missing is the reverse chain of notifications from e.g. IRTE to
the device, either via MSIs or via some pins of IOAPIC.
I don't think I have very good knowledge on the whole IRQ path yet so I
can't really tell anything useful, but what you said looks like a good
thing to have. If it can cleanup things besides achieving the goal of
fault irq reporting it could be more worthwhile.
Thanks,
--
Peter Xu
next prev parent reply other threads:[~2023-03-10 20:14 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-05 18:43 [PATCH] hw/intc/ioapic: Update KVM routes before redelivering IRQ, on RTE update David Woodhouse
2023-03-05 22:36 ` Peter Xu
2023-03-06 6:51 ` David Woodhouse
2023-03-06 9:25 ` David Woodhouse
2023-03-06 16:39 ` Peter Xu
2023-03-06 17:28 ` David Woodhouse
2023-03-08 23:09 ` Peter Xu
2023-03-09 9:16 ` David Woodhouse
2023-03-09 16:55 ` Peter Xu
2023-03-09 19:56 ` David Woodhouse
2023-03-10 17:52 ` David Woodhouse
2023-03-10 20:13 ` Peter Xu [this message]
2023-03-11 10:40 ` David Woodhouse
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=ZAuPV0kTb0ruFihj@x1n \
--to=peterx@redhat.com \
--cc=dwmw2@infradead.org \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.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 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).