From: Aurelien Jarno Date: Fri, 25 Sep 2009 09:09:37 +0000 (+0200) Subject: KVM: fix LAPIC timer period overflow X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b2d83cfa3fdefe5c6573d443d099a18dc3a93c5f;p=linux-beck.git 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 Cc: stable@kernel.org Signed-off-by: Marcelo Tosatti --- diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index 1ae5ceba7eb2..7024224f0fc8 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c @@ -664,7 +664,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);