All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: Cornelia Huck <cornelia.huck@de.ibm.com>, qemu-devel@nongnu.org
Cc: gleb@kernel.org, borntraeger@de.ibm.com, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH v4 2/5] kvm: add kvm_enable_cap_{vm,vcpu}
Date: Wed, 09 Apr 2014 15:58:55 +0200	[thread overview]
Message-ID: <5345521F.20402@suse.de> (raw)
In-Reply-To: <1397043298-25755-3-git-send-email-cornelia.huck@de.ibm.com>


On 09.04.14 13:34, Cornelia Huck wrote:
> Provide helper functions for enabling capabilities (on a vcpu and on a vm).
>
> Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>

I think it makes sense to convert all ENABLE_CAP callers of the code 
base to this helper as well. Once you do that, you'll realize that we 
may want to have additional argument parameters ;).


Alex

> ---
>   include/sysemu/kvm.h |    4 ++++
>   kvm-all.c            |   19 ++++++++++++++++++-
>   2 files changed, 22 insertions(+), 1 deletion(-)
>
> diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
> index 0bee1e8..d89911c 100644
> --- a/include/sysemu/kvm.h
> +++ b/include/sysemu/kvm.h
> @@ -294,6 +294,10 @@ bool kvm_arch_stop_on_emulation_error(CPUState *cpu);
>   
>   int kvm_check_extension(KVMState *s, unsigned int extension);
>   
> +int kvm_enable_cap_vm(KVMState *s, unsigned int capability);
> +
> +int kvm_enable_cap_vcpu(CPUState *cpu, unsigned int capability);
> +
>   uint32_t kvm_arch_get_supported_cpuid(KVMState *env, uint32_t function,
>                                         uint32_t index, int reg);
>   
> diff --git a/kvm-all.c b/kvm-all.c
> index cd4111d..c32eeff 100644
> --- a/kvm-all.c
> +++ b/kvm-all.c
> @@ -501,7 +501,24 @@ int kvm_check_extension(KVMState *s, unsigned int extension)
>       return ret;
>   }
>   
> -static int kvm_set_ioeventfd_mmio(int fd, hwaddr addr, uint32_t val,
> +int kvm_enable_cap_vm(KVMState *s, unsigned int capability)
> +{
> +    struct kvm_enable_cap cap = {};
> +
> +    cap.cap = capability;
> +    return kvm_vm_ioctl(s, KVM_ENABLE_CAP, &cap);
> +}
> +
> +int kvm_enable_cap_vcpu(CPUState *cpu, unsigned int capability)
> +{
> +    struct kvm_enable_cap cap = {};
> +
> +    cap.cap = capability;
> +    return kvm_vcpu_ioctl(cpu, KVM_ENABLE_CAP, &cap);
> +}
> +
> +
> +static int kvm_set_ioeventfd_mmio(int fd, uint32_t addr, uint32_t val,
>                                     bool assign, uint32_t size, bool datamatch)
>   {
>       int ret;

  reply	other threads:[~2014-04-09 13:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-09 11:34 [Qemu-devel] [PATCH v4 0/5] qemu: irqfds for s390x Cornelia Huck
2014-04-09 11:34 ` [Qemu-devel] [PATCH v4 1/5] linux-headers: update Cornelia Huck
2014-04-09 11:34 ` [Qemu-devel] [PATCH v4 2/5] kvm: add kvm_enable_cap_{vm,vcpu} Cornelia Huck
2014-04-09 13:58   ` Alexander Graf [this message]
2014-04-09 14:16     ` Cornelia Huck
2014-04-09 11:34 ` [Qemu-devel] [PATCH v4 3/5] s390x: Add I/O adapter registration Cornelia Huck
2014-04-09 14:05   ` Alexander Graf
2014-04-09 14:24     ` Cornelia Huck
2014-04-09 14:30       ` Alexander Graf
2014-04-09 15:35         ` Cornelia Huck
2014-04-09 15:53           ` Alexander Graf
2014-04-09 16:20             ` Cornelia Huck
2014-04-09 11:34 ` [Qemu-devel] [PATCH v4 4/5] s390x/virtio-ccw: reference-counted indicators Cornelia Huck
2014-04-09 11:34 ` [Qemu-devel] [PATCH v4 5/5] s390x/virtio-ccw: Wire up irq routing and irqfds Cornelia Huck

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=5345521F.20402@suse.de \
    --to=agraf@suse.de \
    --cc=borntraeger@de.ibm.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=gleb@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.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.