From: Marcelo Tosatti <mtosatti@redhat.com>
To: Avi Kivity <avi@qumranet.com>, Chris Wright <chrisw@redhat.com>
Cc: kvm-devel <kvm@vger.kernel.org>
Subject: [patch 2/4] libkvm: KVM_GET_PMTIMER ioctl support
Date: Sat, 24 May 2008 20:43:44 -0300 [thread overview]
Message-ID: <20080525000036.580903867@localhost.localdomain> (raw)
In-Reply-To: 20080524234342.983197667@localhost.localdomain
[-- Attachment #1: kvm_pmtimer --]
[-- Type: text/plain, Size: 1203 bytes --]
Unfortunately there seems to be no standard interface to read the
pmtimer...
Index: kvm-userspace.tip/libkvm/libkvm.c
===================================================================
--- kvm-userspace.tip.orig/libkvm/libkvm.c
+++ kvm-userspace.tip/libkvm/libkvm.c
@@ -794,6 +794,17 @@ int kvm_set_mpstate(kvm_context_t kvm, i
return -ENOSYS;
}
#endif
+#ifdef KVM_CAP_GET_PMTIMER
+int kvm_get_pmtimer(kvm_context_t kvm, struct kvm_pmtimer *pmtmr)
+{
+ int r;
+
+ r = ioctl(kvm->fd, KVM_CHECK_EXTENSION, KVM_CAP_GET_PMTIMER);
+ if (r > 0)
+ return ioctl(kvm->vm_fd, KVM_GET_PMTIMER, pmtmr);
+ return -ENOSYS;
+}
+#endif
static int handle_mmio(kvm_context_t kvm, struct kvm_run *kvm_run)
{
Index: kvm-userspace.tip/libkvm/libkvm.h
===================================================================
--- kvm-userspace.tip.orig/libkvm/libkvm.h
+++ kvm-userspace.tip/libkvm/libkvm.h
@@ -325,6 +325,13 @@ static inline int kvm_reset_mpstate(kvm_
}
#endif
+#ifdef KVM_CAP_GET_PMTIMER
+/*!
+ * \brief Read host pmtimer value
+ */
+int kvm_get_pmtimer(kvm_context_t kvm, struct kvm_pmtimer *pmtmr);
+#endif
+
/*!
* \brief Simulate an external vectored interrupt
*
--
next prev parent reply other threads:[~2008-05-25 0:02 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-24 23:43 [patch 0/4] C2 "emulation" Marcelo Tosatti
2008-05-24 23:43 ` [patch 1/4] QEMU/KVM: self-disabling C2 emulation Marcelo Tosatti
2008-05-24 23:43 ` Marcelo Tosatti [this message]
2008-05-24 23:43 ` [patch 3/4] QEMU/KVM: non-virtualized ACPI PMTimer support Marcelo Tosatti
2008-05-25 10:18 ` Avi Kivity
2008-05-25 16:32 ` Marcelo Tosatti
2008-05-26 8:16 ` Avi Kivity
2008-05-29 17:56 ` Marcelo Tosatti
2008-05-31 7:52 ` Avi Kivity
2008-05-25 10:19 ` Avi Kivity
2008-05-25 17:39 ` Marcelo Tosatti
2008-05-26 8:23 ` Avi Kivity
2008-05-24 23:43 ` [patch 4/4] KVM: allow direct access to PMTimer port Marcelo Tosatti
2008-05-25 10:04 ` Avi Kivity
2008-05-25 16:09 ` Marcelo Tosatti
2008-05-25 12:31 ` Avi Kivity
2008-05-25 16:12 ` Marcelo Tosatti
2008-05-26 8:03 ` 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=20080525000036.580903867@localhost.localdomain \
--to=mtosatti@redhat.com \
--cc=avi@qumranet.com \
--cc=chrisw@redhat.com \
--cc=kvm@vger.kernel.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