From: Sheng Yang <sheng@linux.intel.com>
To: Avi Kivity <avi@redhat.com>, Marcelo Tosatti <mtosatti@redhat.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
kvm@vger.kernel.org, Sheng Yang <sheng@linux.intel.com>
Subject: [PATCH 1/5] qemu-kvm: Add kvm_enable_cap() interface for x86
Date: Wed, 20 Oct 2010 16:29:51 +0800 [thread overview]
Message-ID: <1287563395-30039-2-git-send-email-sheng@linux.intel.com> (raw)
In-Reply-To: <1287563395-30039-1-git-send-email-sheng@linux.intel.com>
Signed-off-by: Sheng Yang <sheng@linux.intel.com>
---
qemu-kvm.c | 16 ++++++++++++++++
qemu-kvm.h | 8 ++++++++
2 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/qemu-kvm.c b/qemu-kvm.c
index 733d0a9..fbb68f6 100644
--- a/qemu-kvm.c
+++ b/qemu-kvm.c
@@ -540,6 +540,22 @@ int kvm_set_xcrs(CPUState *env, struct kvm_xcrs *xcrs)
}
#endif
+#ifdef KVM_CAP_ENABLE_CAP
+int kvm_enable_cap(CPUState *env, uint32_t cap)
+{
+ int r = 0;
+ struct kvm_enable_cap enable_cap = {
+ .cap = cap,
+ .flags = 0,
+ };
+
+ r = kvm_ioctl(kvm_state, KVM_CHECK_EXTENSION, KVM_CAP_ENABLE_CAP);
+ if (r > 0)
+ r = kvm_vcpu_ioctl(env, KVM_ENABLE_CAP, &enable_cap);
+ return r;
+}
+#endif
+
static int handle_mmio(CPUState *env)
{
unsigned long addr = env->kvm_run->mmio.phys_addr;
diff --git a/qemu-kvm.h b/qemu-kvm.h
index 9c08ab4..5cac0c2 100644
--- a/qemu-kvm.h
+++ b/qemu-kvm.h
@@ -316,6 +316,14 @@ int kvm_get_xcrs(CPUState *env, struct kvm_xcrs *xcrs);
int kvm_set_xcrs(CPUState *env, struct kvm_xcrs *xcrs);
#endif
+#ifdef KVM_ENABLE_CAP
+/*!
+ * * \brief Enable specific capability of KVM
+ *
+ */
+int kvm_enable_cap(CPUState *env, uint32_t cap);
+#endif
+
/*!
* \brief Simulate an external vectored interrupt
*
--
1.7.0.1
next prev parent reply other threads:[~2010-10-20 8:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-20 8:29 [PATCH 0/5] MSI-X mask support for assigned device on userspace Sheng Yang
2010-10-20 8:29 ` Sheng Yang [this message]
2010-10-20 8:29 ` [PATCH 2/5] qemu-kvm: Ioctl for in-kernel mask support Sheng Yang
2010-10-20 8:29 ` [PATCH 3/5] qemu-kvm: device assignment: Some clean up about MSI-X code Sheng Yang
2010-10-20 8:29 ` [PATCH 4/5] qemu-kvm: device assignment: emulate MSI-X mask bits Sheng Yang
2010-10-20 8:29 ` [PATCH 5/5] qemu-kvm: device assignment: Enable in-kernel MSI-X mask support Sheng Yang
2010-10-20 22:36 ` Michael S. Tsirkin
2010-10-21 7:12 ` Sheng Yang
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=1287563395-30039-2-git-send-email-sheng@linux.intel.com \
--to=sheng@linux.intel.com \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mst@redhat.com \
--cc=mtosatti@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox