All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gregory Haskins <ghaskins@novell.com>
To: Avi Kivity <avi@redhat.com>
Cc: Gregory Haskins <gregory.haskins@gmail.com>,
	Chris Wright <chrisw@sous-sol.org>,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	Anthony Liguori <anthony@codemonkey.ws>
Subject: Re: [RFC PATCH 0/3] generic hypercall support
Date: Thu, 07 May 2009 16:07:10 -0400	[thread overview]
Message-ID: <4A033F6E.3010604@novell.com> (raw)
In-Reply-To: <4A0339D2.3050600@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 3090 bytes --]

Avi Kivity wrote:
> Gregory Haskins wrote:
>>> Don't - it's broken.  It will also catch device assignment mmio and
>>> hypercall them.
>>>
>>>     
>> Ah.  Crap.
>>
>> Would you be conducive if I continue along with the dynhc() approach
>> then?
>>   
>
> Oh yes.  But don't call it dynhc - like Chris says it's the wrong
> semantic.
>
> Since we want to connect it to an eventfd, call it HC_NOTIFY or
> HC_EVENT or something along these lines.  You won't be able to pass
> any data, but that's fine.  Registers are saved to memory anyway.
Ok, but how would you access the registers since you would presumably
only be getting a waitq::func callback on the eventfd.  Or were you
saying that more data, if required, is saved in a side-band memory
location?  I can see the latter working.  I can't wrap my head around
the former.

>
> And btw, given that eventfd and the underlying infrastructure are so
> flexible, it's probably better to go back to your original "irqfd gets
> fd from userspace" just to be consistent everywhere.
>
> (no, I'm not deliberately making you rewrite that patch again and
> again... it's going to be a key piece of infrastructure so I want to
> get it right)

Ok, np.  Actually now that Davide showed me the waitq::func trick, the
fd technically doesn't even need to be an eventfd per se.  We can just
plain-old "fget()" it and attach via the f_ops->poll() as I do in v5. 
Ill submit this later today.

>
>
> Just to make sure we have everything plumbed down, here's how I see
> things working out (using qemu and virtio, use sed to taste):
>
> 1. qemu starts up, sets up the VM
> 2. qemu creates virtio-net-server
> 3. qemu allocates six eventfds: irq, stopirq, notify (one set for tx
> ring, one set for rx ring)
> 4. qemu connects the six eventfd to the data-available,
> data-not-available, and kick ports of virtio-net-server
> 5. the guest starts up and configures virtio-net in pci pin mode
> 6. qemu notices and decides it will manage interrupts in user space
> since this is complicated (shared level triggered interrupts)
> 7. the guest OS boots, loads device driver
> 8. device driver switches virtio-net to msix mode
> 9. qemu notices, plumbs the irq fds as msix interrupts, plumbs the
> notify fds as notifyfd
> 10. look ma, no hands.
>
> Under the hood, the following takes place.
>
> kvm wires the irqfds to schedule a work item which fires the
> interrupt.  One day the kvm developers get their act together and
> change it to inject the interrupt directly when the irqfd is signalled
> (which could be from the net softirq or somewhere similarly nasty).
>
> virtio-net-server wires notifyfd according to its liking.  It may
> schedule a thread, or it may execute directly.
>
> And they all lived happily ever after.

Ack.  I hope when its all said and done I can convince you that the
framework to code up those virtio backends in the kernel is vbus ;)  But
even if not, this should provide enough plumbing that we can all coexist
together peacefully.

Thanks,
-Greg


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 266 bytes --]

  reply	other threads:[~2009-05-07 20:07 UTC|newest]

Thread overview: 115+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-05 13:24 [RFC PATCH 0/3] generic hypercall support Gregory Haskins
2009-05-05 13:24 ` [RFC PATCH 1/3] add " Gregory Haskins
2009-05-05 17:03   ` Hollis Blanchard
2009-05-06 13:52   ` Anthony Liguori
2009-05-06 15:16     ` Gregory Haskins
2009-05-06 16:52       ` Arnd Bergmann
2009-05-05 13:24 ` [RFC PATCH 2/3] x86: " Gregory Haskins
2009-05-05 13:24 ` [RFC PATCH 3/3] kvm: add pv_cpu_ops.hypercall support to the guest Gregory Haskins
2009-05-05 13:36 ` [RFC PATCH 0/3] generic hypercall support Avi Kivity
2009-05-05 13:40   ` Gregory Haskins
2009-05-05 14:00     ` Avi Kivity
2009-05-05 14:14       ` Gregory Haskins
2009-05-05 14:21         ` Gregory Haskins
2009-05-05 15:02         ` Avi Kivity
2009-05-05 23:17         ` Chris Wright
2009-05-06  3:51           ` Gregory Haskins
2009-05-06  7:22             ` Chris Wright
2009-05-06 13:17               ` Gregory Haskins
2009-05-06 16:07                 ` Chris Wright
2009-05-07 17:03                   ` Gregory Haskins
2009-05-07 18:05                     ` Avi Kivity
2009-05-07 18:08                       ` Gregory Haskins
2009-05-07 18:12                         ` Avi Kivity
2009-05-07 18:16                           ` Gregory Haskins
2009-05-07 18:24                             ` Avi Kivity
2009-05-07 18:37                               ` Gregory Haskins
2009-05-07 19:00                                 ` Avi Kivity
2009-05-07 19:05                                   ` Gregory Haskins
2009-05-07 19:43                                     ` Avi Kivity
2009-05-07 20:07                                       ` Gregory Haskins [this message]
2009-05-07 20:15                                         ` Avi Kivity
2009-05-07 20:26                                           ` Gregory Haskins
2009-05-08  8:35                                             ` Avi Kivity
2009-05-08 11:29                                               ` Gregory Haskins
2009-05-07 19:07                                   ` Chris Wright
2009-05-07 19:12                                     ` Gregory Haskins
2009-05-07 19:21                                       ` Chris Wright
2009-05-07 19:26                                         ` Avi Kivity
2009-05-07 19:44                                           ` Avi Kivity
2009-05-07 19:29                                         ` Gregory Haskins
2009-05-07 20:25                                           ` Chris Wright
2009-05-07 20:34                                             ` Gregory Haskins
2009-05-07 20:54                                           ` Arnd Bergmann
2009-05-07 21:13                                             ` Gregory Haskins
2009-05-07 21:57                                               ` Chris Wright
2009-05-07 22:11                                                 ` Arnd Bergmann
2009-05-08 22:33                                                   ` Benjamin Herrenschmidt
2009-05-11 13:01                                                     ` Arnd Bergmann
2009-05-11 13:04                                                       ` Gregory Haskins
2009-05-07 20:00                             ` Arnd Bergmann
2009-05-07 20:31                               ` Gregory Haskins
2009-05-07 20:42                                 ` Arnd Bergmann
2009-05-07 20:47                                   ` Arnd Bergmann
2009-05-07 20:50                                 ` Chris Wright
2009-05-07 23:35                     ` Marcelo Tosatti
2009-05-07 23:43                       ` Marcelo Tosatti
2009-05-08  3:17                         ` Gregory Haskins
2009-05-08  7:55                         ` Avi Kivity
     [not found]                           ` <20090508103253.GC3011@amt.cnet>
2009-05-08 11:37                             ` Avi Kivity
2009-05-08 14:35                           ` Marcelo Tosatti
2009-05-08 14:45                             ` Gregory Haskins
2009-05-08 15:51                               ` Marcelo Tosatti
2009-05-08 19:56                                 ` David S. Ahern
2009-05-08 20:01                                   ` Gregory Haskins
2009-05-08 23:23                                     ` David S. Ahern
2009-05-09  8:45                                       ` Avi Kivity
2009-05-09 11:27                                         ` Gregory Haskins
2009-05-10  4:27                                           ` David S. Ahern
2009-05-10  5:24                                             ` Avi Kivity
2009-05-10  4:24                                         ` David S. Ahern
2009-05-08  3:13                       ` Gregory Haskins
2009-05-08  7:59                       ` Avi Kivity
2009-05-08 11:09                         ` Gregory Haskins
     [not found]                         ` <20090508104228.GD3011@amt.cnet>
2009-05-08 12:43                           ` Gregory Haskins
2009-05-08 15:33                             ` Marcelo Tosatti
2009-05-08 19:02                               ` Avi Kivity
2009-05-08 16:48                             ` Paul E. McKenney
2009-05-08 19:55                               ` Gregory Haskins
2009-05-08 14:15                       ` Gregory Haskins
2009-05-08 14:53                         ` Anthony Liguori
2009-05-08 18:50                           ` Avi Kivity
2009-05-08 19:02                             ` Anthony Liguori
2009-05-08 19:06                               ` Avi Kivity
2009-05-11 16:37                               ` Jeremy Fitzhardinge
2009-05-07 12:29                 ` Avi Kivity
2009-05-08 14:59                   ` Anthony Liguori
2009-05-09 12:01                     ` Gregory Haskins
2009-05-10 18:38                       ` Anthony Liguori
2009-05-11 13:14                         ` Gregory Haskins
2009-05-11 16:35                           ` Hollis Blanchard
2009-05-11 17:06                             ` Avi Kivity
2009-05-11 17:29                               ` Gregory Haskins
2009-05-11 17:53                                 ` Avi Kivity
2009-05-11 17:51                               ` Anthony Liguori
2009-05-11 18:02                                 ` Avi Kivity
2009-05-11 18:18                                   ` Anthony Liguori
2009-05-11 17:31                           ` Anthony Liguori
2009-05-13 10:53                             ` Gregory Haskins
2009-05-13 14:45                             ` Gregory Haskins
2009-05-11 16:44                         ` Hollis Blanchard
2009-05-11 17:54                           ` Anthony Liguori
2009-05-11 19:24                             ` PowerPC page faults Hollis Blanchard
2009-05-11 22:17                               ` Anthony Liguori
2009-05-12  5:46                                 ` Liu Yu-B13201
2009-05-12 14:50                                 ` Hollis Blanchard
2009-05-06 13:56             ` [RFC PATCH 0/3] generic hypercall support Anthony Liguori
2009-05-06 16:03               ` Gregory Haskins
2009-05-08  8:17                 ` Avi Kivity
2009-05-08 15:20                   ` Gregory Haskins
2009-05-08 17:00                     ` Avi Kivity
2009-05-08 18:55                       ` Gregory Haskins
2009-05-08 19:05                         ` Anthony Liguori
2009-05-08 19:12                         ` Avi Kivity
2009-05-08 19:59                           ` Gregory Haskins
2009-05-10  9:59                             ` Avi Kivity

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=4A033F6E.3010604@novell.com \
    --to=ghaskins@novell.com \
    --cc=anthony@codemonkey.ws \
    --cc=avi@redhat.com \
    --cc=chrisw@sous-sol.org \
    --cc=gregory.haskins@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.