From: "Michael S. Tsirkin" <mst@redhat.com>
To: Avi Kivity <avi@redhat.com>
Cc: Alex Williamson <alex.williamson@redhat.com>,
gleb@redhat.com, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v9 1/2] kvm: Use a reserved IRQ source ID for irqfd
Date: Wed, 5 Sep 2012 18:28:32 +0300 [thread overview]
Message-ID: <20120905152832.GE11058@redhat.com> (raw)
In-Reply-To: <50476E51.5020005@redhat.com>
On Wed, Sep 05, 2012 at 06:22:57PM +0300, Avi Kivity wrote:
> On 09/05/2012 06:13 PM, Michael S. Tsirkin wrote:
> > On Wed, Sep 05, 2012 at 05:59:46PM +0300, Avi Kivity wrote:
> >> On 09/05/2012 05:51 PM, Michael S. Tsirkin wrote:
> >> > On Wed, Sep 05, 2012 at 05:35:43PM +0300, Avi Kivity wrote:
> >> >> On 08/22/2012 03:41 AM, Michael S. Tsirkin wrote:
> >> >> >>
> >> >> >> I assumed you were pointing out the level vs edge interaction. If we
> >> >> >> call that a userspace bug, I can just drop this. Thanks,
> >> >> >>
> >> >> >> Alex
> >> >> >
> >> >> > level is userspace bug I think :)
> >> >>
> >> >> I don't see how it's a bug. Suppose we have a vfio device that shares a
> >> >> gsi with an emulated device. The emulated device naturally uses
> >> >> KVM_IRQ_LINE (it has no need to re-sample on ADN), while vfio naturally
> >> >> has to use irqfd.
> >> >
> >> > Absolutely. But vfio needs to use irqfd with the new flag.
> >> > Using existing irqfd for level is a bug.
> >>
> >> I see we're not reusing this irq source id for level irqfd. But I think
> >> we should, there's no need for per-gsi irq source id.
> >
> > I agree. All resample irqfds are deasserted at the same time,
> > tracking them separately gets us nothing.
>
> That's not the reason. Separate irq source ids only have meanings
> within a gsi. We could have two lines (gsi 3 isid 4) and (gsi 4 isid 4)
> that can be toggled independently with no effect on the other gsi.
> Within a gsi we do need a separate irq source id usually, but as 2/2
> recognizes, AODNs are a special case since we clear all inputs anyway.
> The end result is that all AODNs can share a single isid.
>
> >
> >> Plus I'd like to
> >> fix the theoretical bug even if it doesn't bite in practice.
> >>
> >
> > I'm not sure what the bug is, for edge, and how a separate ID fixes it.
> > Could you clarify?
>
> gsi 3 is configured as edge in the ioapic. It has (unusually) two
> inputs: one driven by userspace, the other by irqfd.
>
> cpu 0 cpu 1
> ------------------------ -------------------------
> irqfd: set to 1
> ioapic: recognize edge
> inject irq
> EOI
> KVM_IRQ_LINE: set to 1
> ioapic: ignore
> KVM_IRQ_LINE: set to 0
> irqfd: set to 0
>
> We had two edges with an EOI between them, but injected just on interrupt.
I see. Makes sense, ACK this patch.
> --
> error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2012-09-05 15:27 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-21 19:28 [PATCH v9 0/2] kvm: level irqfd support Alex Williamson
2012-08-21 19:29 ` [PATCH v9 1/2] kvm: Use a reserved IRQ source ID for irqfd Alex Williamson
2012-08-21 19:58 ` Michael S. Tsirkin
2012-08-21 20:06 ` Alex Williamson
2012-08-21 20:41 ` Michael S. Tsirkin
2012-08-21 21:14 ` Alex Williamson
2012-08-22 0:41 ` Michael S. Tsirkin
2012-08-22 1:34 ` Alex Williamson
2012-09-05 14:35 ` Avi Kivity
2012-09-05 14:51 ` Michael S. Tsirkin
2012-09-05 14:59 ` Avi Kivity
2012-09-05 15:13 ` Michael S. Tsirkin
2012-09-05 15:22 ` Avi Kivity
2012-09-05 15:28 ` Michael S. Tsirkin [this message]
2012-09-05 15:35 ` Avi Kivity
2012-09-05 15:09 ` Michael S. Tsirkin
2012-09-05 15:12 ` Avi Kivity
2012-09-05 15:15 ` Michael S. Tsirkin
2012-09-05 14:46 ` Avi Kivity
2012-09-05 15:07 ` Michael S. Tsirkin
2012-09-05 15:15 ` Avi Kivity
2012-08-21 19:29 ` [PATCH v9 2/2] kvm: On Ack, De-assert & Notify KVM_IRQFD extension Alex Williamson
2012-08-21 20:37 ` Michael S. Tsirkin
2012-08-21 21:11 ` Alex Williamson
2012-08-22 0:14 ` Michael S. Tsirkin
2012-08-22 1:48 ` Alex Williamson
2012-09-05 14:57 ` Avi Kivity
2012-09-17 16:13 ` Alex Williamson
2012-08-22 0:31 ` [PATCH v9 0/2] kvm: level irqfd support Michael S. Tsirkin
2012-08-22 1:28 ` Alex Williamson
2012-08-22 8:25 ` Michael S. Tsirkin
2012-09-17 18:08 ` Alex Williamson
2012-08-22 10:10 ` Michael S. Tsirkin
2012-09-05 14:42 ` Avi Kivity
2012-09-05 14:52 ` Michael S. Tsirkin
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=20120905152832.GE11058@redhat.com \
--to=mst@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=avi@redhat.com \
--cc=gleb@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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