* [PATCH 5/6] kvm: libkvm: Add interface for PIT save/restore supporting
@ 2008-03-04 10:23 Yang, Sheng
0 siblings, 0 replies; 2+ messages in thread
From: Yang, Sheng @ 2008-03-04 10:23 UTC (permalink / raw)
To: kvm-devel
[-- Attachment #1: Type: text/plain, Size: 2379 bytes --]
From 79f06bc838534fc916f9ca90f89b7778b8e64dfe Mon Sep 17 00:00:00 2001
From: Sheng Yang <sheng.yang@intel.com>
Date: Tue, 4 Mar 2008 09:42:27 +0800
Subject: [PATCH] kvm: libkvm: Add interface for PIT save/restore supporting
Signed-off-by: Sheng Yang <sheng.yang@intel.com>
---
libkvm/libkvm-x86.c | 30 ++++++++++++++++++++++++++++++
libkvm/libkvm.h | 26 ++++++++++++++++++++++++++
2 files changed, 56 insertions(+), 0 deletions(-)
diff --git a/libkvm/libkvm-x86.c b/libkvm/libkvm-x86.c
index 22a6283..1d56273 100644
--- a/libkvm/libkvm-x86.c
+++ b/libkvm/libkvm-x86.c
@@ -361,6 +361,36 @@ int kvm_set_lapic(kvm_context_t kvm, int vcpu, struct
kvm_lapic_state *s)
#endif
+#ifdef KVM_CAP_PIT
+
+int kvm_get_pit(kvm_context_t kvm, struct kvm_pit_state *s)
+{
+ int r;
+ if (!kvm->pit_in_kernel)
+ return 0;
+ r = ioctl(kvm->vm_fd, KVM_GET_PIT, s);
+ if (r == -1) {
+ r = -errno;
+ perror("kvm_get_pit");
+ }
+ return r;
+}
+
+int kvm_set_pit(kvm_context_t kvm, struct kvm_pit_state *s)
+{
+ int r;
+ if (!kvm->pit_in_kernel)
+ return 0;
+ r = ioctl(kvm->vm_fd, KVM_SET_PIT, s);
+ if (r == -1) {
+ r = -errno;
+ perror("kvm_set_pit");
+ }
+ return r;
+}
+
+#endif
+
void kvm_show_code(kvm_context_t kvm, int vcpu)
{
#define CR0_PE_MASK (1ULL<<0)
diff --git a/libkvm/libkvm.h b/libkvm/libkvm.h
index 395434c..4b40d2c 100644
--- a/libkvm/libkvm.h
+++ b/libkvm/libkvm.h
@@ -525,8 +525,34 @@ int kvm_get_lapic(kvm_context_t kvm, int vcpu, struct
kvm_lapic_state *s);
* \param s Local apic state of the specific virtual CPU
*/
int kvm_set_lapic(kvm_context_t kvm, int vcpu, struct kvm_lapic_state *s);
+
+#endif
+
#endif
+#ifdef KVM_CAP_PIT
+
+/*!
+ * \brief Get in kernel PIT of the virtual domain
+ *
+ * Save the PIT state.
+ *
+ * \param kvm Pointer to the current kvm_context
+ * \param s PIT state of the virtual domain
+ */
+int kvm_get_pit(kvm_context_t kvm, struct kvm_pit_state *s);
+
+/*!
+ * \brief Set in kernel PIT of the virtual domain
+ *
+ * Restore the PIT state.
+ * Timer would be retriggerred after restored.
+ *
+ * \param kvm Pointer to the current kvm_context
+ * \param s PIT state of the virtual domain
+ */
+int kvm_set_pit(kvm_context_t kvm, struct kvm_pit_state *s);
+
#endif
#ifdef KVM_CAP_VAPIC
--
debian.1.5.3.7.1-dirty
[-- Attachment #2: 0003-kvm-libkvm-Add-interface-for-PIT-save-restore-supp.patch --]
[-- Type: text/x-diff, Size: 2380 bytes --]
From 79f06bc838534fc916f9ca90f89b7778b8e64dfe Mon Sep 17 00:00:00 2001
From: Sheng Yang <sheng.yang@intel.com>
Date: Tue, 4 Mar 2008 09:42:27 +0800
Subject: [PATCH] kvm: libkvm: Add interface for PIT save/restore supporting
Signed-off-by: Sheng Yang <sheng.yang@intel.com>
---
libkvm/libkvm-x86.c | 30 ++++++++++++++++++++++++++++++
libkvm/libkvm.h | 26 ++++++++++++++++++++++++++
2 files changed, 56 insertions(+), 0 deletions(-)
diff --git a/libkvm/libkvm-x86.c b/libkvm/libkvm-x86.c
index 22a6283..1d56273 100644
--- a/libkvm/libkvm-x86.c
+++ b/libkvm/libkvm-x86.c
@@ -361,6 +361,36 @@ int kvm_set_lapic(kvm_context_t kvm, int vcpu, struct kvm_lapic_state *s)
#endif
+#ifdef KVM_CAP_PIT
+
+int kvm_get_pit(kvm_context_t kvm, struct kvm_pit_state *s)
+{
+ int r;
+ if (!kvm->pit_in_kernel)
+ return 0;
+ r = ioctl(kvm->vm_fd, KVM_GET_PIT, s);
+ if (r == -1) {
+ r = -errno;
+ perror("kvm_get_pit");
+ }
+ return r;
+}
+
+int kvm_set_pit(kvm_context_t kvm, struct kvm_pit_state *s)
+{
+ int r;
+ if (!kvm->pit_in_kernel)
+ return 0;
+ r = ioctl(kvm->vm_fd, KVM_SET_PIT, s);
+ if (r == -1) {
+ r = -errno;
+ perror("kvm_set_pit");
+ }
+ return r;
+}
+
+#endif
+
void kvm_show_code(kvm_context_t kvm, int vcpu)
{
#define CR0_PE_MASK (1ULL<<0)
diff --git a/libkvm/libkvm.h b/libkvm/libkvm.h
index 395434c..4b40d2c 100644
--- a/libkvm/libkvm.h
+++ b/libkvm/libkvm.h
@@ -525,8 +525,34 @@ int kvm_get_lapic(kvm_context_t kvm, int vcpu, struct kvm_lapic_state *s);
* \param s Local apic state of the specific virtual CPU
*/
int kvm_set_lapic(kvm_context_t kvm, int vcpu, struct kvm_lapic_state *s);
+
+#endif
+
#endif
+#ifdef KVM_CAP_PIT
+
+/*!
+ * \brief Get in kernel PIT of the virtual domain
+ *
+ * Save the PIT state.
+ *
+ * \param kvm Pointer to the current kvm_context
+ * \param s PIT state of the virtual domain
+ */
+int kvm_get_pit(kvm_context_t kvm, struct kvm_pit_state *s);
+
+/*!
+ * \brief Set in kernel PIT of the virtual domain
+ *
+ * Restore the PIT state.
+ * Timer would be retriggerred after restored.
+ *
+ * \param kvm Pointer to the current kvm_context
+ * \param s PIT state of the virtual domain
+ */
+int kvm_set_pit(kvm_context_t kvm, struct kvm_pit_state *s);
+
#endif
#ifdef KVM_CAP_VAPIC
--
debian.1.5.3.7.1-dirty
[-- Attachment #3: Type: text/plain, Size: 228 bytes --]
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
[-- Attachment #4: Type: text/plain, Size: 158 bytes --]
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH 5/6] kvm: libkvm: Add interface for PIT save/restore supporting
@ 2008-03-07 12:52 Yang, Sheng
0 siblings, 0 replies; 2+ messages in thread
From: Yang, Sheng @ 2008-03-07 12:52 UTC (permalink / raw)
To: kvm-devel
[-- Attachment #1: Type: text/plain, Size: 2379 bytes --]
From 6ff60b78c3280505d84d0dc2619e95a087b88458 Mon Sep 17 00:00:00 2001
From: Sheng Yang <sheng.yang@intel.com>
Date: Fri, 7 Mar 2008 19:03:52 +0800
Subject: [PATCH] kvm: libkvm: Add interface for PIT save/restore supporting
Signed-off-by: Sheng Yang <sheng.yang@intel.com>
---
libkvm/libkvm-x86.c | 30 ++++++++++++++++++++++++++++++
libkvm/libkvm.h | 26 ++++++++++++++++++++++++++
2 files changed, 56 insertions(+), 0 deletions(-)
diff --git a/libkvm/libkvm-x86.c b/libkvm/libkvm-x86.c
index d19d17f..d1809fd 100644
--- a/libkvm/libkvm-x86.c
+++ b/libkvm/libkvm-x86.c
@@ -361,6 +361,36 @@ int kvm_set_lapic(kvm_context_t kvm, int vcpu, struct
kvm_lapic_state *s)
#endif
+#ifdef KVM_CAP_PIT
+
+int kvm_get_pit(kvm_context_t kvm, struct kvm_pit_state *s)
+{
+ int r;
+ if (!kvm->pit_in_kernel)
+ return 0;
+ r = ioctl(kvm->vm_fd, KVM_GET_PIT, s);
+ if (r == -1) {
+ r = -errno;
+ perror("kvm_get_pit");
+ }
+ return r;
+}
+
+int kvm_set_pit(kvm_context_t kvm, struct kvm_pit_state *s)
+{
+ int r;
+ if (!kvm->pit_in_kernel)
+ return 0;
+ r = ioctl(kvm->vm_fd, KVM_SET_PIT, s);
+ if (r == -1) {
+ r = -errno;
+ perror("kvm_set_pit");
+ }
+ return r;
+}
+
+#endif
+
void kvm_show_code(kvm_context_t kvm, int vcpu)
{
#define CR0_PE_MASK (1ULL<<0)
diff --git a/libkvm/libkvm.h b/libkvm/libkvm.h
index 395434c..4b40d2c 100644
--- a/libkvm/libkvm.h
+++ b/libkvm/libkvm.h
@@ -525,8 +525,34 @@ int kvm_get_lapic(kvm_context_t kvm, int vcpu, struct
kvm_lapic_state *s);
* \param s Local apic state of the specific virtual CPU
*/
int kvm_set_lapic(kvm_context_t kvm, int vcpu, struct kvm_lapic_state *s);
+
+#endif
+
#endif
+#ifdef KVM_CAP_PIT
+
+/*!
+ * \brief Get in kernel PIT of the virtual domain
+ *
+ * Save the PIT state.
+ *
+ * \param kvm Pointer to the current kvm_context
+ * \param s PIT state of the virtual domain
+ */
+int kvm_get_pit(kvm_context_t kvm, struct kvm_pit_state *s);
+
+/*!
+ * \brief Set in kernel PIT of the virtual domain
+ *
+ * Restore the PIT state.
+ * Timer would be retriggerred after restored.
+ *
+ * \param kvm Pointer to the current kvm_context
+ * \param s PIT state of the virtual domain
+ */
+int kvm_set_pit(kvm_context_t kvm, struct kvm_pit_state *s);
+
#endif
#ifdef KVM_CAP_VAPIC
--
debian.1.5.3.7.1-dirty
[-- Attachment #2: 0003-kvm-libkvm-Add-interface-for-PIT-save-restore-supp.patch --]
[-- Type: text/x-diff, Size: 2380 bytes --]
From 6ff60b78c3280505d84d0dc2619e95a087b88458 Mon Sep 17 00:00:00 2001
From: Sheng Yang <sheng.yang@intel.com>
Date: Fri, 7 Mar 2008 19:03:52 +0800
Subject: [PATCH] kvm: libkvm: Add interface for PIT save/restore supporting
Signed-off-by: Sheng Yang <sheng.yang@intel.com>
---
libkvm/libkvm-x86.c | 30 ++++++++++++++++++++++++++++++
libkvm/libkvm.h | 26 ++++++++++++++++++++++++++
2 files changed, 56 insertions(+), 0 deletions(-)
diff --git a/libkvm/libkvm-x86.c b/libkvm/libkvm-x86.c
index d19d17f..d1809fd 100644
--- a/libkvm/libkvm-x86.c
+++ b/libkvm/libkvm-x86.c
@@ -361,6 +361,36 @@ int kvm_set_lapic(kvm_context_t kvm, int vcpu, struct kvm_lapic_state *s)
#endif
+#ifdef KVM_CAP_PIT
+
+int kvm_get_pit(kvm_context_t kvm, struct kvm_pit_state *s)
+{
+ int r;
+ if (!kvm->pit_in_kernel)
+ return 0;
+ r = ioctl(kvm->vm_fd, KVM_GET_PIT, s);
+ if (r == -1) {
+ r = -errno;
+ perror("kvm_get_pit");
+ }
+ return r;
+}
+
+int kvm_set_pit(kvm_context_t kvm, struct kvm_pit_state *s)
+{
+ int r;
+ if (!kvm->pit_in_kernel)
+ return 0;
+ r = ioctl(kvm->vm_fd, KVM_SET_PIT, s);
+ if (r == -1) {
+ r = -errno;
+ perror("kvm_set_pit");
+ }
+ return r;
+}
+
+#endif
+
void kvm_show_code(kvm_context_t kvm, int vcpu)
{
#define CR0_PE_MASK (1ULL<<0)
diff --git a/libkvm/libkvm.h b/libkvm/libkvm.h
index 395434c..4b40d2c 100644
--- a/libkvm/libkvm.h
+++ b/libkvm/libkvm.h
@@ -525,8 +525,34 @@ int kvm_get_lapic(kvm_context_t kvm, int vcpu, struct kvm_lapic_state *s);
* \param s Local apic state of the specific virtual CPU
*/
int kvm_set_lapic(kvm_context_t kvm, int vcpu, struct kvm_lapic_state *s);
+
+#endif
+
#endif
+#ifdef KVM_CAP_PIT
+
+/*!
+ * \brief Get in kernel PIT of the virtual domain
+ *
+ * Save the PIT state.
+ *
+ * \param kvm Pointer to the current kvm_context
+ * \param s PIT state of the virtual domain
+ */
+int kvm_get_pit(kvm_context_t kvm, struct kvm_pit_state *s);
+
+/*!
+ * \brief Set in kernel PIT of the virtual domain
+ *
+ * Restore the PIT state.
+ * Timer would be retriggerred after restored.
+ *
+ * \param kvm Pointer to the current kvm_context
+ * \param s PIT state of the virtual domain
+ */
+int kvm_set_pit(kvm_context_t kvm, struct kvm_pit_state *s);
+
#endif
#ifdef KVM_CAP_VAPIC
--
debian.1.5.3.7.1-dirty
[-- Attachment #3: Type: text/plain, Size: 228 bytes --]
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
[-- Attachment #4: Type: text/plain, Size: 158 bytes --]
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-03-07 12:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-07 12:52 [PATCH 5/6] kvm: libkvm: Add interface for PIT save/restore supporting Yang, Sheng
-- strict thread matches above, loose matches on Subject: below --
2008-03-04 10:23 Yang, Sheng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox