From 35d2aab27169148f87fe0ec5fe827cd823c9734e Mon Sep 17 00:00:00 2001 From: Glauber de Oliveira Costa Date: Mon, 11 Feb 2008 16:10:12 -0200 Subject: [PATCH] Fill cpuid with clock information we advertise the presence of our paravirt clock through cpuid, if it is defined in headers Signed-off-by: Glauber de Oliveira Costa Signed-off-by: Avi Kivity --- qemu-kvm-x86.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c index 49205fcab4..37354fb739 100644 --- a/qemu-kvm-x86.c +++ b/qemu-kvm-x86.c @@ -520,6 +520,10 @@ int kvm_arch_qemu_init_env(CPUState *cenv) 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; @@ -537,7 +541,7 @@ int kvm_arch_qemu_init_env(CPUState *cenv) 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; -- 2.11.4.GIT