[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] target-i386: avoid overflow in the tsc-frequenc
From: |
Eduardo Habkost |
Subject: |
Re: [Qemu-devel] [PATCH] target-i386: avoid overflow in the tsc-frequency property |
Date: |
Thu, 25 Jun 2015 14:40:45 -0300 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Wed, Jun 24, 2015 at 02:11:27PM +0200, Paolo Bonzini wrote:
> The TSC frequency fits comfortably in an int when expressed in kHz,
> but it may overflow when converted to Hz. In this case,
> tsc-frequency returns a negative value because x86_cpuid_get_tsc_freq
> does a 32-bit multiplication before assigning to int64_t.
>
> For simplicity just make tsc_khz a 64-bit value.
>
> Spotted by Coverity.
>
> Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Applied to the x86 tree. Thanks!
--
Eduardo