Re: [Qemu-devel] [PATCH] target-i386: avoid overflow in the tsc-frequency property

2015-06-25 Thread Eduardo Habkost
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

[Qemu-devel] [PATCH] target-i386: avoid overflow in the tsc-frequency property

2015-06-24 Thread Paolo Bonzini
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