Commit ddf2acb7 authored by Aurelien Jarno's avatar Aurelien Jarno Committed by Greg Kroah-Hartman

KVM: fix LAPIC timer period overflow

commit b2d83cfa upstream.

Don't overflow when computing the 64-bit period from 32-bit registers.

Fixes sourceforge bug #2826486.
Signed-off-by: default avatarAurelien Jarno <aurelien@aurel32.net>
Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent ca9405b8
...@@ -567,7 +567,7 @@ static void start_apic_timer(struct kvm_lapic *apic) ...@@ -567,7 +567,7 @@ static void start_apic_timer(struct kvm_lapic *apic)
{ {
ktime_t now = apic->lapic_timer.timer.base->get_time(); 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; APIC_BUS_CYCLE_NS * apic->divide_count;
atomic_set(&apic->lapic_timer.pending, 0); atomic_set(&apic->lapic_timer.pending, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment