From: Glauber de Oliveira Costa Subject: [PATCH 2/2] fill cpuid with clock information Date: Mon, 11 Feb 2008 16:10:12 -0200 Message-ID: <1202753412-15407-3-git-send-email-gcosta@redhat.com> References: <1202753412-15407-1-git-send-email-gcosta@redhat.com> <1202753412-15407-2-git-send-email-gcosta@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: chrisw@sous-sol.org, avi@qumranet.com, Glauber de Oliveira Costa To: kvm-devel@lists.sourceforge.net Return-path: In-Reply-To: <1202753412-15407-2-git-send-email-gcosta@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces@lists.sourceforge.net Errors-To: kvm-devel-bounces@lists.sourceforge.net List-Id: kvm.vger.kernel.org we advertise the presence of our paravirt clock through cpuid, if it is defined in headers Signed-off-by: Glauber de Oliveira Costa --- 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/