From: Marcelo Tosatti <mtosatti@redhat.com>
To: Avi Kivity <avi@qumranet.com>
Cc: kvm-devel@lists.sourceforge.net, Marcelo Tosatti <mtosatti@redhat.com>
Subject: [patch 2/5] QEMU/KVM: Add libkvm interface to get/set the mpstate.
Date: Fri, 11 Apr 2008 13:24:42 -0300 [thread overview]
Message-ID: <20080411162949.060745535@localhost.localdomain> (raw)
In-Reply-To: 20080411162440.693057357@localhost.localdomain
[-- Attachment #1: smpmig-libkvm --]
[-- Type: text/plain, Size: 2126 bytes --]
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Index: kvm-userspace.io/libkvm/libkvm.c
===================================================================
--- kvm-userspace.io.orig/libkvm/libkvm.c
+++ kvm-userspace.io/libkvm/libkvm.c
@@ -776,6 +776,28 @@ int kvm_set_sregs(kvm_context_t kvm, int
return ioctl(kvm->vcpu_fd[vcpu], KVM_SET_SREGS, sregs);
}
+#ifdef KVM_CAP_MP_STATE
+int kvm_get_mpstate(kvm_context_t kvm, int vcpu, struct kvm_mp_state *mp_state)
+{
+ int r;
+
+ r = ioctl(kvm->fd, KVM_CHECK_EXTENSION, KVM_CAP_MP_STATE);
+ if (r > 0)
+ return ioctl(kvm->vcpu_fd[vcpu], KVM_GET_MP_STATE, mp_state);
+ return -ENOSYS;
+}
+
+int kvm_set_mpstate(kvm_context_t kvm, int vcpu, struct kvm_mp_state *mp_state)
+{
+ int r;
+
+ r = ioctl(kvm->fd, KVM_CHECK_EXTENSION, KVM_CAP_MP_STATE);
+ if (r > 0)
+ return ioctl(kvm->vcpu_fd[vcpu], KVM_SET_MP_STATE, mp_state);
+ return -ENOSYS;
+}
+#endif
+
static int handle_mmio(kvm_context_t kvm, struct kvm_run *kvm_run)
{
unsigned long addr = kvm_run->mmio.phys_addr;
Index: kvm-userspace.io/libkvm/libkvm.h
===================================================================
--- kvm-userspace.io.orig/libkvm/libkvm.h
+++ kvm-userspace.io/libkvm/libkvm.h
@@ -300,6 +300,22 @@ int kvm_get_sregs(kvm_context_t kvm, int
*/
int kvm_set_sregs(kvm_context_t kvm, int vcpu, struct kvm_sregs *regs);
+#ifdef KVM_CAP_MP_STATE
+/*!
+ * * \brief Read VCPU MP state
+ *
+ */
+int kvm_get_mpstate(kvm_context_t kvm, int vcpu,
+ struct kvm_mp_state *mp_state);
+
+/*!
+ * * \brief Write VCPU MP state
+ *
+ */
+int kvm_set_mpstate(kvm_context_t kvm, int vcpu,
+ struct kvm_mp_state *mp_state);
+#endif
+
/*!
* \brief Simulate an external vectored interrupt
*
--
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
next prev parent reply other threads:[~2008-04-11 16:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-11 16:24 [patch 0/5] fix SMP migration and loadvm/savevm (V3) Marcelo Tosatti
2008-04-11 16:24 ` [patch 1/5] QEMU/KVM: properly copy the in-kernel apicbase value Marcelo Tosatti
2008-04-11 16:24 ` Marcelo Tosatti [this message]
2008-04-11 16:24 ` [patch 3/5] QEMU/KVM: save and load mp state Marcelo Tosatti
2008-04-11 16:24 ` [patch 4/5] QEMU/KVM: ignore SIG_IPI signals in userspace Marcelo Tosatti
2008-04-11 16:24 ` [patch 5/5] KVM: add ioctls to save/store mpstate Marcelo Tosatti
2008-04-13 14:59 ` Avi Kivity
2008-04-13 15:01 ` [patch 0/5] fix SMP migration and loadvm/savevm (V3) Avi Kivity
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=20080411162949.060745535@localhost.localdomain \
--to=mtosatti@redhat.com \
--cc=avi@qumranet.com \
--cc=kvm-devel@lists.sourceforge.net \
/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