From patchwork Fri Sep 25 09:11:46 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "SourceForge.net" X-Patchwork-Id: 50117 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8P9BoeM023646 for ; Fri, 25 Sep 2009 09:11:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752890AbZIYJLo (ORCPT ); Fri, 25 Sep 2009 05:11:44 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752847AbZIYJLo (ORCPT ); Fri, 25 Sep 2009 05:11:44 -0400 Received: from ch3.sourceforge.net ([216.34.181.60]:42137 "EHLO ch3.sourceforge.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752736AbZIYJLn (ORCPT ); Fri, 25 Sep 2009 05:11:43 -0400 Received: from www by 155xhf1.ch3.sourceforge.com with local (Exim 4.69) (envelope-from ) id 1Mr6qA-00072Z-Ks; Fri, 25 Sep 2009 09:11:46 +0000 To: noreply@sourceforge.net From: "SourceForge.net" Subject: [ kvm-Bugs-2826486 ] Clock speed in FreeBSD Mime-Version: 1.0 X-SourceForge-Tracker-unixname: kvm X-SourceForge-Tracker-trackerid: 893831 X-SourceForge-Tracker-itemid: 2826486 X-SourceForge-Tracker-itemstatus: Open X-SourceForge-Tracker-itemassignee: nobody X-SourceForge-Tracker-itemupdate-reason: Comment added X-SourceForge-Tracker-itemupdate-username: aurel32 Message-Id: Date: Fri, 25 Sep 2009 09:11:46 +0000 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Bugs item #2826486, was opened at 2009-07-24 11:16 Message generated for change (Comment added) made by aurel32 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=893831&aid=2826486&group_id=180599 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: POLYMORF34 (polymorf34) Assigned to: Nobody/Anonymous (nobody) Summary: Clock speed in FreeBSD Initial Comment: I use KVM 88 and KVM 85 on Gentoo GNU/Linux 2.6.29, running on Intel Core2 CPU 6320 and Intel Xeon CPU E5405, both in 64 bits mode. All gests running on FreeBSD 7.1-p5 in 64 bits with -smp 1. The first machine host only one gest. The "sleep" command on FreeBSD does not work has expected. All sleep time are multiplied by 3 Example : freebsdmachine ~ # time sleep 1 real 0m3.148s user 0m0.000s sys 0m0.002s freebsdmachine ~ # time sleep 10 real 0m31.429s user 0m0.009s sys 0m0.002s With the "-no-kvm" flag, the "sleep" command works has expected. ---------------------------------------------------------------------- Comment By: Aurelien Jarno (aurel32) Date: 2009-09-25 11:11 Message: The following patch fixes the problem for me (already posted on the mailing list). From 0dc540e09345ad5a1b99acbc92a7eab60029cec3 Mon Sep 17 00:00:00 2001 From: Aurelien Jarno Date: Fri, 25 Sep 2009 11:01:30 +0200 Subject: [PATCH] KVM: fix LAPIC timer period overflow Don't overflow when computing the 64-bit period from 32-bit registers. Fixes sourceforge bug #2826486. Signed-off-by: Aurelien Jarno --- arch/x86/kvm/lapic.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index 9c8f901..3ca7767 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c @@ -658,7 +658,7 @@ static void start_apic_timer(struct kvm_lapic *apic) { ktime_t now = apic->lapic_timer.timer.base->get_time(); - apic->lapic_timer.period = apic_get_reg(apic, APIC_TMICT) * + apic->lapic_timer.period = (u64)apic_get_reg(apic, APIC_TMICT) * APIC_BUS_CYCLE_NS * apic->divide_count; atomic_set(&apic->lapic_timer.pending, 0);