All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v3] virtio-pci: Disable virtio-ioeventfd when !CONFIG_IOTHREAD
@ 2011-01-25 16:17 Stefan Hajnoczi
  2011-01-25 17:42 ` [Qemu-devel] " Michael S. Tsirkin
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Hajnoczi @ 2011-01-25 16:17 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Stefan Hajnoczi, Michael S. Tsirkin

It is not possible to use virtio-ioeventfd when building without an I/O
thread.  We rely on a signal to kick us out of vcpu execution.  Timers
and AIO use SIGALRM and SIGUSR2 respectively.  Unfortunately eventfd
does not support O_ASYNC (SIGIO) so eventfd cannot be used in a signal
driven manner.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
 kvm-all.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/kvm-all.c b/kvm-all.c
index 255b6fa..8f0e17c 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -449,10 +449,14 @@ int kvm_check_extension(KVMState *s, unsigned int extension)
 
 static int kvm_check_many_ioeventfds(void)
 {
-    /* Older kernels have a 6 device limit on the KVM io bus.  Find out so we
+    /* Userspace can use ioeventfd for io notification.  This requires a host
+     * that supports eventfd(2) and an I/O thread; since eventfd does not
+     * support SIGIO it cannot interrupt the vcpu.
+     *
+     * Older kernels have a 6 device limit on the KVM io bus.  Find out so we
      * can avoid creating too many ioeventfds.
      */
-#ifdef CONFIG_EVENTFD
+#if defined(CONFIG_EVENTFD) && defined(CONFIG_IOTHREAD)
     int ioeventfds[7];
     int i, ret = 0;
     for (i = 0; i < ARRAY_SIZE(ioeventfds); i++) {
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Qemu-devel] Re: [PATCH v3] virtio-pci: Disable virtio-ioeventfd when !CONFIG_IOTHREAD
  2011-01-25 16:17 [Qemu-devel] [PATCH v3] virtio-pci: Disable virtio-ioeventfd when !CONFIG_IOTHREAD Stefan Hajnoczi
@ 2011-01-25 17:42 ` Michael S. Tsirkin
  2011-01-26 10:19   ` Kevin Wolf
  0 siblings, 1 reply; 3+ messages in thread
From: Michael S. Tsirkin @ 2011-01-25 17:42 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: Kevin Wolf, qemu-devel

On Tue, Jan 25, 2011 at 04:17:14PM +0000, Stefan Hajnoczi wrote:
> It is not possible to use virtio-ioeventfd when building without an I/O
> thread.  We rely on a signal to kick us out of vcpu execution.  Timers
> and AIO use SIGALRM and SIGUSR2 respectively.  Unfortunately eventfd
> does not support O_ASYNC (SIGIO) so eventfd cannot be used in a signal
> driven manner.
> 
> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>

Acked-by: Michael S. Tsirkin <mst@redhat.com>

> ---
>  kvm-all.c |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/kvm-all.c b/kvm-all.c
> index 255b6fa..8f0e17c 100644
> --- a/kvm-all.c
> +++ b/kvm-all.c
> @@ -449,10 +449,14 @@ int kvm_check_extension(KVMState *s, unsigned int extension)
>  
>  static int kvm_check_many_ioeventfds(void)
>  {
> -    /* Older kernels have a 6 device limit on the KVM io bus.  Find out so we
> +    /* Userspace can use ioeventfd for io notification.  This requires a host
> +     * that supports eventfd(2) and an I/O thread; since eventfd does not
> +     * support SIGIO it cannot interrupt the vcpu.
> +     *
> +     * Older kernels have a 6 device limit on the KVM io bus.  Find out so we
>       * can avoid creating too many ioeventfds.
>       */
> -#ifdef CONFIG_EVENTFD
> +#if defined(CONFIG_EVENTFD) && defined(CONFIG_IOTHREAD)
>      int ioeventfds[7];
>      int i, ret = 0;
>      for (i = 0; i < ARRAY_SIZE(ioeventfds); i++) {
> -- 
> 1.7.2.3

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Qemu-devel] Re: [PATCH v3] virtio-pci: Disable virtio-ioeventfd when !CONFIG_IOTHREAD
  2011-01-25 17:42 ` [Qemu-devel] " Michael S. Tsirkin
@ 2011-01-26 10:19   ` Kevin Wolf
  0 siblings, 0 replies; 3+ messages in thread
From: Kevin Wolf @ 2011-01-26 10:19 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: Stefan Hajnoczi, qemu-devel

Am 25.01.2011 18:42, schrieb Michael S. Tsirkin:
> On Tue, Jan 25, 2011 at 04:17:14PM +0000, Stefan Hajnoczi wrote:
>> It is not possible to use virtio-ioeventfd when building without an I/O
>> thread.  We rely on a signal to kick us out of vcpu execution.  Timers
>> and AIO use SIGALRM and SIGUSR2 respectively.  Unfortunately eventfd
>> does not support O_ASYNC (SIGIO) so eventfd cannot be used in a signal
>> driven manner.
>>
>> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
> 
> Acked-by: Michael S. Tsirkin <mst@redhat.com>

I guess this means that it should go through my tree? I applied it to
the block branch now.

Kevin

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-01-26 10:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-25 16:17 [Qemu-devel] [PATCH v3] virtio-pci: Disable virtio-ioeventfd when !CONFIG_IOTHREAD Stefan Hajnoczi
2011-01-25 17:42 ` [Qemu-devel] " Michael S. Tsirkin
2011-01-26 10:19   ` Kevin Wolf

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.