qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: Avi Kivity <avi@redhat.com>, Marcelo Tosatti <mtosatti@redhat.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	kvm@vger.kernel.org
Subject: [Qemu-devel] [PATCH 3/4] kvm: Add kvm_has_pit_state2 helper
Date: Sun,  5 Feb 2012 11:46:29 +0100	[thread overview]
Message-ID: <6776cc5c00f4d06d23c11b68d18fd96e27f71718.1328438750.git.jan.kiszka@web.de> (raw)
In-Reply-To: <cover.1328438750.git.jan.kiszka@web.de>
In-Reply-To: <cover.1328438750.git.jan.kiszka@web.de>

From: Jan Kiszka <jan.kiszka@siemens.com>

To be used for in-kernel PIT emulation.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 kvm-all.c  |   10 ++++++++++
 kvm-stub.c |    5 +++++
 kvm.h      |    1 +
 3 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/kvm-all.c b/kvm-all.c
index c4babda..bddf922 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -75,6 +75,7 @@ struct KVMState
     struct kvm_sw_breakpoint_head kvm_sw_breakpoints;
 #endif
     int pit_in_kernel;
+    int pit_state2;
     int xsave, xcrs;
     int many_ioeventfds;
     int irqchip_inject_ioctl;
@@ -954,6 +955,10 @@ int kvm_init(void)
     s->xcrs = kvm_check_extension(s, KVM_CAP_XCRS);
 #endif
 
+#ifdef KVM_CAP_PIT_STATE2
+    s->pit_state2 = kvm_check_extension(s, KVM_CAP_PIT_STATE2);
+#endif
+
     ret = kvm_arch_init(s);
     if (ret < 0) {
         goto err;
@@ -1291,6 +1296,11 @@ int kvm_has_xcrs(void)
     return kvm_state->xcrs;
 }
 
+int kvm_has_pit_state2(void)
+{
+    return kvm_state->pit_state2;
+}
+
 int kvm_has_many_ioeventfds(void)
 {
     if (!kvm_enabled()) {
diff --git a/kvm-stub.c b/kvm-stub.c
index f63a0d2..1f1c686 100644
--- a/kvm-stub.c
+++ b/kvm-stub.c
@@ -78,6 +78,11 @@ int kvm_allows_irq0_override(void)
     return 1;
 }
 
+int kvm_has_pit_state2(void)
+{
+    return 0;
+}
+
 void kvm_setup_guest_memory(void *start, size_t size)
 {
 }
diff --git a/kvm.h b/kvm.h
index f9f1dc8..8ef4476 100644
--- a/kvm.h
+++ b/kvm.h
@@ -54,6 +54,7 @@ int kvm_has_robust_singlestep(void);
 int kvm_has_debugregs(void);
 int kvm_has_xsave(void);
 int kvm_has_xcrs(void);
+int kvm_has_pit_state2(void);
 int kvm_has_many_ioeventfds(void);
 int kvm_has_gsi_routing(void);
 
-- 
1.7.3.4

  parent reply	other threads:[~2012-02-05 10:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-05 10:46 [Qemu-devel] [PATCH 0/4] uq/master: Introduce KVM PIT support Jan Kiszka
2012-02-05 10:46 ` [Qemu-devel] [PATCH 1/4] i8254: Factor out base class for KVM reuse Jan Kiszka
2012-02-05 10:46 ` [Qemu-devel] [PATCH 2/4] i8254: Open-code timer restore Jan Kiszka
2012-02-05 11:23   ` Paolo Bonzini
2012-02-05 11:33     ` Jan Kiszka
2012-02-05 12:03   ` [Qemu-devel] [PATCH 2/4 v3] " Jan Kiszka
2012-02-05 10:46 ` Jan Kiszka [this message]
2012-02-05 20:03   ` [Qemu-devel] [PATCH 3/4] kvm: Add kvm_has_pit_state2 helper Juan Quintela
2012-02-05 20:36     ` Jan Kiszka
2012-02-05 10:46 ` [Qemu-devel] [PATCH 4/4] kvm: x86: Add user space part for in-kernel i8254 Jan Kiszka
2012-02-08 18:24 ` [Qemu-devel] [PATCH 0/4] uq/master: Introduce KVM PIT support Marcelo Tosatti
  -- strict thread matches above, loose matches on Subject: below --
2012-01-31 18:46 Jan Kiszka
2012-01-31 18:46 ` [Qemu-devel] [PATCH 3/4] kvm: Add kvm_has_pit_state2 helper Jan Kiszka

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=6776cc5c00f4d06d23c11b68d18fd96e27f71718.1328438750.git.jan.kiszka@web.de \
    --to=jan.kiszka@web.de \
    --cc=aliguori@us.ibm.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@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;
as well as URLs for NNTP newsgroup(s).