public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark McLoughlin <markmc@redhat.com>
To: Gregory Haskins <gregory.haskins@gmail.com>
Cc: Gregory Haskins <ghaskins@novell.com>,
	Avi Kivity <avi@redhat.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Davide Libenzi <davidel@xmailserver.org>,
	mtosatti@redhat.com
Subject: Re: [KVM PATCH v4 3/3] kvm: add iosignalfd support
Date: Thu, 28 May 2009 10:09:30 +0100	[thread overview]
Message-ID: <1243501772.4046.36.camel@blaa> (raw)
In-Reply-To: <4A1DA653.4050109@gmail.com>

On Wed, 2009-05-27 at 16:45 -0400, Gregory Haskins wrote:
> Mark McLoughlin wrote:
> > The virtio ABI is fixed, so we couldn't e.g. have the guest use a cookie
> > to identify a queue - it's just going to continue using a per-device
> > queue number. 
> 
> Actually, I was originally thinking this would be exposed as a virtio
> FEATURE bit anyway, so there were no backwards-compat constraints.  That
> said, we can possibly make it work in a backwards compat way, too. 
> IIRC, today virtio does a PIO cycle to a specific register with the
> queue-id when it wants to signal guest->host, right?  What is the width
> of the write?

It's a 16-bit write.

/* A 16-bit r/w queue notifier */
#define VIRTIO_PCI_QUEUE_NOTIFY         16

> > So, if the cookie was also the trigger, we'd need an
> > eventfd per device.
> >   
> 
> I'm having trouble parsing this one.  The cookie namespace is controlled
> by the userspace component that owns the corresponding IO address, so
> there's no reason you can't make "queue-id = 0" use cookie = 0, or
> whatever.  That said, I still think a separation of the cookie and
> trigger as suggested above is a good idea, so its probably moot to
> discuss this point further.

Ah, my mistake - I thought the cookie was returned to userspace when the
eventfd was signalled, but no ... userspace only gets an event counter
value and the cookie is used during de-assignment to distinguish between
iosignalfds.

Okay, so suppose you do assign multiple times at a given address -
you're presumably going to use a different eventfd for each assignment?
If so, can't we match using both the address and eventfd at
de-assignment and drop the cookie from the interface altogether?

i.e. to replace the virtio queue notify with this, we'd:

  1) create an eventfd per queue

  2) assign each of those eventfds to the QUEUE_NOTIFY address

  3) have only one of the eventfds be triggered, depending on what 
     value is written by the guest

  4) de-assign using the address/eventfd pair to distinguish between 
     assignments

Cheers,
Mark.


  reply	other threads:[~2009-05-28  9:09 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-26 19:15 [KVM PATCH v4 0/3] iosignalfd Gregory Haskins
2009-05-26 19:15 ` [KVM PATCH v4 1/3] eventfd: export eventfd interfaces for module use Gregory Haskins
2009-05-27  8:57   ` Avi Kivity
2009-05-27 11:53     ` Gregory Haskins
2009-05-26 19:15 ` [KVM PATCH v4 2/3] kvm: make io_bus interface more robust Gregory Haskins
2009-05-27  8:54   ` Avi Kivity
2009-05-27 11:26     ` Gregory Haskins
2009-05-26 19:15 ` [KVM PATCH v4 3/3] kvm: add iosignalfd support Gregory Haskins
2009-05-27  9:03   ` Avi Kivity
2009-05-27 11:47     ` Gregory Haskins
2009-05-27 12:11       ` Avi Kivity
2009-05-27 12:54         ` Gregory Haskins
2009-05-27 17:25         ` Mark McLoughlin
2009-05-27 17:40           ` Gregory Haskins
2009-05-27 17:48             ` Mark McLoughlin
2009-05-27 20:45               ` Gregory Haskins
2009-05-28  9:09                 ` Mark McLoughlin [this message]
2009-05-28 12:12                   ` Gregory Haskins
2009-05-31  9:11                     ` Avi Kivity
2009-06-01 12:14                       ` Gregory Haskins
2009-06-03 22:04               ` Gregory Haskins
2009-06-04 13:20                 ` Mark McLoughlin

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=1243501772.4046.36.camel@blaa \
    --to=markmc@redhat.com \
    --cc=avi@redhat.com \
    --cc=davidel@xmailserver.org \
    --cc=ghaskins@novell.com \
    --cc=gregory.haskins@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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