we advertise the presence of our paravirt clock
through cpuid, if it is defined in headers

Signed-off-by: Glauber de Oliveira Costa <[EMAIL PROTECTED]>
---
 qemu/qemu-kvm-x86.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/qemu/qemu-kvm-x86.c b/qemu/qemu-kvm-x86.c
index 4a52d4d..4daf6cc 100644
--- a/qemu/qemu-kvm-x86.c
+++ b/qemu/qemu-kvm-x86.c
@@ -513,6 +513,10 @@ #endif
     int cpuid_nent = 0;
     CPUState copy;
     uint32_t i, limit;
+    int has_clocksource = 0;
+#ifdef KVM_CAP_CLOCKSOURCE
+    has_clocksource = kvm_check_extension(kvm_context, KVM_CAP_CLOCKSOURCE);
+#endif
 
     copy = *cenv;
 
@@ -530,7 +534,7 @@ #ifdef KVM_CPUID_SIGNATURE
     pv_ent = &cpuid_ent[cpuid_nent++];
     memset(pv_ent, 0, sizeof(*pv_ent));
     pv_ent->function = KVM_CPUID_FEATURES;
-    pv_ent->eax = 0;
+    pv_ent->eax = (has_clocksource << KVM_FEATURE_CLOCKSOURCE);
 #endif
 
     copy.regs[R_EAX] = 0;
-- 
1.4.2


-------------------------------------------------------------------------
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/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to