From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: kvm@vger.kernel.org, linux-s390@vger.kernel.org, qemu-devel@nongnu.org
Cc: borntraeger@de.ibm.com, agraf@suse.de, pbonzini@redhat.com,
gleb@kernel.org, Cornelia Huck <cornelia.huck@de.ibm.com>
Subject: [PATCH 3/6] kvm: add kvm_enable_cap_{vm,vcpu}
Date: Tue, 25 Feb 2014 18:25:17 +0100 [thread overview]
Message-ID: <1393349120-18228-4-git-send-email-cornelia.huck@de.ibm.com> (raw)
In-Reply-To: <1393349120-18228-1-git-send-email-cornelia.huck@de.ibm.com>
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>
---
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 3b25f27..9d2df88 100644
--- a/include/sysemu/kvm.h
+++ b/include/sysemu/kvm.h
@@ -272,6 +272,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 2ca9143..6e6a804 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -499,7 +499,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;
--
1.7.9.5
next prev parent reply other threads:[~2014-02-25 17:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-25 17:25 [PATCH 0/6] qemu: irqfds for s390x Cornelia Huck
2014-02-25 17:25 ` [PATCH 1/6] s390x/virtio-ccw: Adapter interrupt support Cornelia Huck
2014-03-04 9:05 ` [Qemu-devel] " Cornelia Huck
2014-03-04 9:20 ` Christian Borntraeger
2014-02-25 17:25 ` [PATCH 2/6] linux-headers: add new interfaces Cornelia Huck
2014-02-25 17:25 ` Cornelia Huck [this message]
2014-02-25 17:25 ` [PATCH 4/6] s390x: Add I/O adapter registration Cornelia Huck
2014-02-26 8:29 ` Christian Borntraeger
2014-02-26 8:37 ` Cornelia Huck
2014-02-25 17:25 ` [PATCH 5/6] s390x/virtio-ccw: reference-counted indicators Cornelia Huck
2014-02-25 17:25 ` [PATCH 6/6] 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=1393349120-18228-4-git-send-email-cornelia.huck@de.ibm.com \
--to=cornelia.huck@de.ibm.com \
--cc=agraf@suse.de \
--cc=borntraeger@de.ibm.com \
--cc=gleb@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linux-s390@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox