From: Avi Kivity <avi@redhat.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>, kvm <kvm@vger.kernel.org>,
"Michael S. Tsirkin" <mst@redhat.com>,
Eric Northup <digitaleric@google.com>
Subject: Re: [PATCH] KVM: Introduce generic interrupt injection for in-kernel irqchips
Date: Tue, 24 Apr 2012 14:54:55 +0300 [thread overview]
Message-ID: <4F96948F.9040302@redhat.com> (raw)
In-Reply-To: <4F957B5C.7060802@siemens.com>
On 04/23/2012 06:55 PM, Jan Kiszka wrote:
> On 2012-04-23 17:32, Avi Kivity wrote:
> > On 04/10/2012 09:30 PM, Jan Kiszka wrote:
> >> Currently, MSI messages can only be injected to in-kernel irqchips by
> >> defining a corresponding IRQ route for each message. This is not only
> >> unhandy if the MSI messages are generated "on the fly" by user space,
> >> IRQ routes are a limited resource that user space has to manage
> >> carefully.
> >>
> >> By providing a direct injection path, we can both avoid using up limited
> >> resources and simplify the necessary steps for user land. This path is
> >> provide in a way that allows for use with other interrupt sources as
> >> well. Besides MSIs also external interrupt lines can be manipulated
> >> through this interface, obsoleting KVM_IRQ_LINE_STATUS.
> >>
> >> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> >> ---
> >>
> >> This picks up Avi's first suggestion as I still think it is the better
> >> option to provide a direct MSI injection channel.
> >
> > My main objection to the previous patch was that it's not needed; qemu
> > has to work with older kernels that have neither this nor the other
> > patch. Given that, why do anything further? It won't be cleaner
> > because the ugly path will remain for compatibility.
> >
> > Is there any concrete problem that this solves, that cannot be solved by
> > a pure (but ugly) user space solution?
>
> As I explained a few times: We avoid taking the lengthy path in
> userspace, GSI exhaustion, sporadic routing flushes etc. when running on
> a modern kernel. The "ugly" part in userspace is rather small as we can
> refrain from optimizing it. Specifically we do not need to touch QEMU
> all over the MSI path just for KVM.
Okay, I guess waiting for a grace period in order to queue an interrupt
is excessive.
> >
> > wrt the patch itself, it seems fine. I have to agree that the
> > single-purpose ioctl looks cleaner (but may be less suitable for a
> > syscall based API).
>
> Why would some MSI-only injection IOCTL be problematic for a syscall
> model?
It increases the number of syscalls, and doesn't bound it if new
interrupt types (like MSI with source information) becomes available.
However, this thinking shouldn't influence the ioctl interface too much.
> I rather suspect the generic IOCTL may have some limitations as
> it /might/ be used for mixing broadcasts with solely VCPU-targeted IRQ
> injections one day, on some arch.
Well we can do that now, with either interface, since MSIs can be
unicast or multicast.
> >
> > Just to add some confusion: is this future proof wrt iommu/interrupt
> > remapping emulation? If you have a single iommu that intercepts all of
> > the MSI space then there's no problem, but if there are multiple iommus,
> > or if some devices are "in front of" the iommu, then we need to identify
> > the source of the message as well. So we'd need an MBZ field for MSI
> > injection, which can later be filled with the source ID.
>
> We will need hierarchical dispatching, using additional source
> information. But that information is totally unrelated to the pseudo GSI
> currently used by KVM for the final delivery step to the APIC bus. In
> fact, the whole message content can be unrelated as it can be modified
> and even coalesced with other sources along its way to the KVM injection
> API.
Depends on whether we emulate interrupt remapping in the kernel or
userspace.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2012-04-24 11:55 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-28 17:47 [PATCH v2] KVM: Introduce direct MSI message injection for in-kernel irqchips Jan Kiszka
2012-03-28 17:52 ` Jan Kiszka
2012-03-28 19:58 ` Eric Northup
2012-03-28 20:21 ` Jan Kiszka
2012-03-29 15:39 ` Michael S. Tsirkin
2012-03-29 15:43 ` Jan Kiszka
2012-03-29 16:15 ` [PATCH v3] " Jan Kiszka
2012-03-29 16:46 ` Michael S. Tsirkin
2012-03-29 16:50 ` Jan Kiszka
2012-03-29 18:25 ` Jan Kiszka
2012-03-29 19:14 ` [PATCH v4] " Jan Kiszka
2012-03-29 19:41 ` Michael S. Tsirkin
2012-03-30 7:45 ` Jan Kiszka
2012-03-30 12:45 ` Michael S. Tsirkin
2012-04-03 16:27 ` Avi Kivity
2012-04-03 16:47 ` Jan Kiszka
2012-04-03 16:54 ` Avi Kivity
2012-04-03 17:24 ` Jan Kiszka
2012-04-04 8:47 ` Avi Kivity
2012-04-04 8:38 ` Michael S. Tsirkin
2012-04-04 8:44 ` Avi Kivity
2012-04-04 8:53 ` Michael S. Tsirkin
2012-04-04 9:22 ` Jan Kiszka
2012-04-04 9:36 ` Avi Kivity
2012-04-04 9:38 ` Jan Kiszka
2012-04-04 9:55 ` Avi Kivity
2012-04-04 10:48 ` Jan Kiszka
2012-04-04 11:50 ` Avi Kivity
2012-04-04 12:01 ` Jan Kiszka
2012-04-10 18:30 ` [PATCH] KVM: Introduce generic interrupt " Jan Kiszka
2012-04-23 14:44 ` Jan Kiszka
2012-04-23 15:17 ` Avi Kivity
2012-04-23 15:32 ` Avi Kivity
2012-04-23 15:55 ` Jan Kiszka
2012-04-24 11:54 ` Avi Kivity [this message]
2012-04-24 11:57 ` [PATCH v4] KVM: Introduce direct MSI message " Avi Kivity
2012-04-24 12:07 ` Jan Kiszka
2012-04-24 12:59 ` Avi Kivity
2012-04-24 13:24 ` Jan Kiszka
2012-04-11 22:10 ` [PATCH v3] " Marcelo Tosatti
2012-04-12 9:28 ` Jan Kiszka
2012-04-12 22:38 ` Marcelo Tosatti
2012-04-13 13:45 ` Jan Kiszka
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=4F96948F.9040302@redhat.com \
--to=avi@redhat.com \
--cc=digitaleric@google.com \
--cc=jan.kiszka@siemens.com \
--cc=kvm@vger.kernel.org \
--cc=mst@redhat.com \
--cc=mtosatti@redhat.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