Received: from eggs.gnu.org ([2001:4830:134:3::10]:41737) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8B8r-0001kg-To for qemu-devel@nongnu.org; Thu, 25 Jun 2015 13:40:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z8B8q-00054S-T3 for qemu-devel@nongnu.org; Thu, 25 Jun 2015 13:40:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42010) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8B8p-00053O-VT for qemu-devel@nongnu.org; Thu, 25 Jun 2015 13:40:48 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 107EE91DA2 for ; Thu, 25 Jun 2015 17:40:47 +0000 (UTC) Date: Thu, 25 Jun 2015 14:40:45 -0300 From: Eduardo Habkost Message-ID: <20150625174045.GC3134@thinpad.lan.raisama.net> References: <1435147887-2149-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1435147887-2149-1-git-send-email-pbonzini@redhat.com> Subject: Re: [Qemu-devel] [PATCH] target-i386: avoid overflow in the tsc-frequency property List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org 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 Reviewed-by: Eduardo Habkost Applied to the x86 tree. Thanks! -- Eduardo