linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Avi Kivity <avi@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC] kvm: enable irq injection from interrupt context
Date: Fri, 17 Sep 2010 09:59:29 +0200	[thread overview]
Message-ID: <20100917075929.GA11518@redhat.com> (raw)
In-Reply-To: <20100916220715.GA30531@redhat.com>

On Fri, Sep 17, 2010 at 12:07:15AM +0200, Michael S. Tsirkin wrote:
> On Thu, Sep 16, 2010 at 05:43:26PM +0200, Gleb Natapov wrote:
> > On Thu, Sep 16, 2010 at 05:24:11PM +0200, Michael S. Tsirkin wrote:
> > > On Thu, Sep 16, 2010 at 04:51:17PM +0200, Gleb Natapov wrote:
> > > > > > What for? Device emulation should do de-assert.
> > > > > 
> > > > > Sorry, but at this point I have no idea what you call device emulation.
> > > > The same thing everyone calls device emulation. In case of virtio-net it
> > > > is in hw/virtio-net.c. If vhost-net is in use device emulation is split
> > > > between userspace and kernel, but it is still just device emulation.
> > > 
> > > 
> > > case in point, virtio net does not know about pci at all,
> > > so it can not deassert.
> > > 
> > I don't see what PCI has to do with it. virtio-net device implementation is
> > split between several files. virtio-net/virtio-ring/virtio-pci. All of
> > them still implement one emulated device. Whoever implemented virtio-net
> > initially decided to put irq ack register into PCI config space, so code
> > that does de-assert is in virtio-pci,
> > but it is still part of emulated
> > device.
> > 
> > > > > qemu has code to de-assert. vhost has code to assert.
> > > > Good. So qemu will de-assert. So what do you mean by
> > > > "KVM would need to find all irqfd objects mapped to gsi and notify
> > > > them on deassert"
> > > > 
> > > > > I would like to optimize level interrupts and stop driving
> > > > > scheduler insane if at all possible.
> > > > > 
> > > > Worthy goal. Do it in irqfd. Irqfd shouldn't call kvm_set_irq() if irq
> > > > level hasn't changed.
> > > 
> > > Right. Then it needs to know about deasserts. It does not get this
> > Dessert should be done by qemu writing 0 into irqfd.
> 
> writing 0 to eventfd does nothing. The way to deassert irq
That is implementation detail of current irqfd. It was designed for MSI
not level triggered interrupts.

> is currently through ioctl and it seems entirely sensible
> to me to keep it that way.
Then do not complain.

> 
> Also - which irqfd :)
> We need multiple irqfds to map to a single gsi, with kvm
> doing OR on them.
Forget about gsi for now. Care only about your device state. KVM will
keep track of sharing.  Although having irqfd per gsi and keep tracking
there in not a bad idea.

> 
> > Assertion and
> > de-assertion should be done through irqfd.
> > > information, so when kvm gets deassert ioctl it should
> > > locate irqfd object and set level to 0.
> > > See?
> > No.
> > 
> > --
> > 			Gleb.

--
			Gleb.

  reply	other threads:[~2010-09-17  7:59 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-15 18:54 [PATCH RFC] kvm: enable irq injection from interrupt context Michael S. Tsirkin
2010-09-16  9:02 ` Gleb Natapov
2010-09-16  9:10   ` Michael S. Tsirkin
2010-09-16  9:25     ` Gleb Natapov
2010-09-16  9:43       ` Michael S. Tsirkin
2010-09-16  9:46       ` Avi Kivity
2010-09-16  9:53         ` Michael S. Tsirkin
2010-09-16 10:13           ` Gleb Natapov
2010-09-16 10:13             ` Michael S. Tsirkin
2010-09-16 10:20               ` Gleb Natapov
2010-09-16 10:44                 ` Michael S. Tsirkin
2010-09-16 10:54                   ` Gleb Natapov
2010-09-16 10:53                     ` Michael S. Tsirkin
2010-09-16 11:17                       ` Gleb Natapov
2010-09-16 12:13                         ` Michael S. Tsirkin
2010-09-16 12:33                           ` Gleb Natapov
2010-09-16 12:57                             ` Michael S. Tsirkin
2010-09-16 13:14                               ` Avi Kivity
2010-09-16 13:38                                 ` Michael S. Tsirkin
2010-09-16 13:50                                   ` Avi Kivity
2010-09-16 13:55                                   ` Gleb Natapov
2010-09-16 13:18                               ` Gleb Natapov
2010-09-16 13:51                                 ` Michael S. Tsirkin
2010-09-16 14:06                                   ` Gleb Natapov
2010-09-16 14:23                                     ` Michael S. Tsirkin
2010-09-16 14:51                                       ` Gleb Natapov
2010-09-16 15:24                                         ` Michael S. Tsirkin
2010-09-16 15:43                                           ` Gleb Natapov
2010-09-16 22:07                                             ` Michael S. Tsirkin
2010-09-17  7:59                                               ` Gleb Natapov [this message]
2010-09-19 10:45                                                 ` Michael S. Tsirkin
2010-09-19 10:56                                                   ` Avi Kivity
2010-09-19 10:55                                                     ` Michael S. Tsirkin
2010-09-19 11:05                                                       ` Avi Kivity
2010-09-19 11:23                                                         ` Michael S. Tsirkin
2010-09-19 11:18                                                       ` Gleb Natapov
2010-09-19 11:21                                                         ` 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=20100917075929.GA11518@redhat.com \
    --to=gleb@redhat.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@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;
as well as URLs for NNTP newsgroup(s).