[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] IA32: init_xen_time potential bug


  • To: "xen-devel" <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: "Dong, Eddie" <eddie.dong@xxxxxxxxx>
  • Date: Thu, 28 Apr 2005 13:46:58 +0800
  • Delivery-date: Thu, 28 Apr 2005 05:46:56 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: AcVLtbF4v8kbUYjxRpWTqSf3PKJKoA==
  • Thread-topic: IA32: init_xen_time potential bug

Hi:
        The following code in init_xen_time of file arch/x86/time.c have
potential problem to support any cpu_freq >= 4GHZ, as the variable scale
is in u64 format and will overflow when rdtsc_bitshift > 2. I am
doubting the necessary of rdtsc_bitshift, introducing this conecpt has
no obvious benefit but will slow down the interrupt handler. 
Eddie


    cpu_ghz = (unsigned int)(cpu_freq / 1000000000ULL);
    for ( rdtsc_bitshift = 0; cpu_ghz != 0; rdtsc_bitshift++, cpu_ghz
>>= 1 )
        continue;

    scale  = 1000000000LL << (32 + rdtsc_bitshift);
    scale /= cpu_freq;

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.