From: Paolo Bonzini <pbonzini@redhat.com>
To: snabb-devel@googlegroups.com, qemu-devel@nongnu.org
Cc: a.motakis@virtualopensystems.com, luke@snabb.co,
tech@virtualopensystems.com, n.nikolaev@virtualopensystems.com,
mst@redhat.com
Subject: Re: [Qemu-devel] [PATCH v10 01/18] Add kvm_eventfds_enabled function
Date: Thu, 05 Jun 2014 16:00:18 +0200 [thread overview]
Message-ID: <539077F2.6060508@redhat.com> (raw)
In-Reply-To: <20140527120330.15172.91211.stgit@3820>
Il 27/05/2014 14:03, Nikolay Nikolaev ha scritto:
> Add a function to check if the eventfd capability is present in KVM in
> the host kernel.
>
> Signed-off-by: Antonios Motakis <a.motakis@virtualopensystems.com>
> Signed-off-by: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>
> ---
> include/sysemu/kvm.h | 11 +++++++++++
> kvm-all.c | 4 ++++
> kvm-stub.c | 1 +
> 3 files changed, 16 insertions(+)
>
> diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
> index e7ad9d1..1c7f5f6 100644
> --- a/include/sysemu/kvm.h
> +++ b/include/sysemu/kvm.h
> @@ -43,6 +43,7 @@ extern bool kvm_allowed;
> extern bool kvm_kernel_irqchip;
> extern bool kvm_async_interrupts_allowed;
> extern bool kvm_halt_in_kernel_allowed;
> +extern bool kvm_eventfds_allowed;
> extern bool kvm_irqfds_allowed;
> extern bool kvm_msi_via_irqfd_allowed;
> extern bool kvm_gsi_routing_allowed;
> @@ -83,6 +84,15 @@ extern bool kvm_readonly_mem_allowed;
> #define kvm_halt_in_kernel() (kvm_halt_in_kernel_allowed)
>
> /**
> + * kvm_eventfds_enabled:
> + *
> + * Returns: true if we can use eventfds to receive notifications
> + * from a KVM CPU (ie the kernel supports eventds and we are running
> + * with a configuration where it is meaningful to use them).
> + */
> +#define kvm_eventfds_enabled() (kvm_eventfds_allowed)
> +
> +/**
> * kvm_irqfds_enabled:
> *
> * Returns: true if we can use irqfds to inject interrupts into
> @@ -128,6 +138,7 @@ extern bool kvm_readonly_mem_allowed;
> #define kvm_irqchip_in_kernel() (false)
> #define kvm_async_interrupts_enabled() (false)
> #define kvm_halt_in_kernel() (false)
> +#define kvm_eventfds_enabled() (false)
> #define kvm_irqfds_enabled() (false)
> #define kvm_msi_via_irqfd_enabled() (false)
> #define kvm_gsi_routing_allowed() (false)
> diff --git a/kvm-all.c b/kvm-all.c
> index a343ede..9649cd3 100644
> --- a/kvm-all.c
> +++ b/kvm-all.c
> @@ -112,6 +112,7 @@ KVMState *kvm_state;
> bool kvm_kernel_irqchip;
> bool kvm_async_interrupts_allowed;
> bool kvm_halt_in_kernel_allowed;
> +bool kvm_eventfds_allowed;
> bool kvm_irqfds_allowed;
> bool kvm_msi_via_irqfd_allowed;
> bool kvm_gsi_routing_allowed;
> @@ -1504,6 +1505,9 @@ int kvm_init(MachineClass *mc)
> (kvm_check_extension(s, KVM_CAP_READONLY_MEM) > 0);
> #endif
>
> + kvm_eventfds_allowed =
> + (kvm_check_extension(s, KVM_CAP_IOEVENTFD) > 0);
> +
> ret = kvm_arch_init(s);
> if (ret < 0) {
> goto err;
> diff --git a/kvm-stub.c b/kvm-stub.c
> index 8acda86..3fb17f2 100644
> --- a/kvm-stub.c
> +++ b/kvm-stub.c
> @@ -22,6 +22,7 @@
> KVMState *kvm_state;
> bool kvm_kernel_irqchip;
> bool kvm_async_interrupts_allowed;
> +bool kvm_eventfds_allowed;
> bool kvm_irqfds_allowed;
> bool kvm_msi_via_irqfd_allowed;
> bool kvm_gsi_routing_allowed;
>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
next prev parent reply other threads:[~2014-06-05 14:00 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20140527120050.15172.94908.stgit@3820>
2014-06-04 19:30 ` [Qemu-devel] [PATCH v10 00/18] Vhost and vhost-net support for userspace based backends Michael S. Tsirkin
2014-06-04 20:03 ` [Qemu-devel] [snabb-devel] " Nikolay Nikolaev
[not found] ` <20140527120330.15172.91211.stgit@3820>
2014-06-05 14:00 ` Paolo Bonzini [this message]
[not found] ` <20140527120638.15172.80806.stgit@3820>
2014-06-05 14:37 ` [Qemu-devel] [PATCH v10 15/18] Add the vhost-user netdev backend to the command line Luiz Capitulino
2014-06-09 13:28 ` [Qemu-devel] [snabb-devel] " Nikolay Nikolaev
2014-06-09 13:31 ` Michael S. Tsirkin
2014-06-09 13:43 ` Nikolay Nikolaev
2014-06-05 16:08 ` [Qemu-devel] " Eric Blake
2014-06-09 21:19 ` [Qemu-devel] [snabb-devel] " Nikolay Nikolaev
2014-06-09 22:22 ` Eric Blake
[not found] ` <20140527120651.15172.72895.stgit@3820>
2014-06-05 16:17 ` [Qemu-devel] [PATCH v10 16/18] Add vhost-user protocol documentation Eric Blake
2014-06-08 15:05 ` Michael S. Tsirkin
2014-06-08 15:12 ` [Qemu-devel] [PATCH v10 00/18] Vhost and vhost-net support for userspace based backends Michael S. Tsirkin
2014-06-09 10:14 ` [Qemu-devel] [snabb-devel] " Nikolay Nikolaev
[not found] ` <20140527120718.15172.9772.stgit@3820>
2014-07-09 14:24 ` [Qemu-devel] [PATCH v10 18/18] Add qtest for vhost-user Kevin Wolf
2014-07-09 15:09 ` [Qemu-devel] [snabb-devel] " Nikolay Nikolaev
2014-07-11 18:35 ` [Qemu-devel] " Michael S. Tsirkin
2014-07-11 18:35 ` [Qemu-devel] [snabb-devel] " Nikolay Nikolaev
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=539077F2.6060508@redhat.com \
--to=pbonzini@redhat.com \
--cc=a.motakis@virtualopensystems.com \
--cc=luke@snabb.co \
--cc=mst@redhat.com \
--cc=n.nikolaev@virtualopensystems.com \
--cc=qemu-devel@nongnu.org \
--cc=snabb-devel@googlegroups.com \
--cc=tech@virtualopensystems.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 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.