WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] IA32: init_xen_time potential bug

To: "xen-devel" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] IA32: init_xen_time potential bug
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
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] IA32: init_xen_time potential bug, Dong, Eddie <=