* [PATCH] KVM: fix LAPIC timer period overflow
@ 2009-09-25 9:09 Aurelien Jarno
2009-09-28 16:33 ` Marcelo Tosatti
0 siblings, 1 reply; 2+ messages in thread
From: Aurelien Jarno @ 2009-09-25 9:09 UTC (permalink / raw)
To: kvm
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>
---
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);
--
1.6.4.3
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] KVM: fix LAPIC timer period overflow
2009-09-25 9:09 [PATCH] KVM: fix LAPIC timer period overflow Aurelien Jarno
@ 2009-09-28 16:33 ` Marcelo Tosatti
0 siblings, 0 replies; 2+ messages in thread
From: Marcelo Tosatti @ 2009-09-28 16:33 UTC (permalink / raw)
To: Aurelien Jarno; +Cc: kvm
On Fri, Sep 25, 2009 at 11:09:37AM +0200, Aurelien Jarno wrote:
> 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>
> ---
> 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);
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-09-28 16:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-25 9:09 [PATCH] KVM: fix LAPIC timer period overflow Aurelien Jarno
2009-09-28 16:33 ` Marcelo Tosatti
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).