Skip to content

Commit

Permalink
KVM: fix LAPIC timer period overflow
Browse files Browse the repository at this point in the history
Don't overflow when computing the 64-bit period from 32-bit registers.

Fixes sourceforge bug #2826486.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Cc: stable@kernel.org
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
  • Loading branch information
Aurelien Jarno authored and Avi Kivity committed Oct 4, 2009
1 parent 8feda6f commit b2d83cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/kvm/lapic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit b2d83cf

Please sign in to comment.