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

Re: [Xen-devel] cpufreq: weird bug in set_time_scale

To: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Subject: Re: [Xen-devel] cpufreq: weird bug in set_time_scale
From: Jean Pihet <jpihet@xxxxxxxxxx>
Date: Thu, 11 Oct 2007 20:48:35 +0200
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, "Langsdorf, Mark" <mark.langsdorf@xxxxxxx>
Delivery-date: Thu, 11 Oct 2007 11:48:34 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <C3342AA9.EBDA%Keir.Fraser@xxxxxxxxxxxx>
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>
Organization: MontaVista
References: <C3342AA9.EBDA%Keir.Fraser@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.9.7
Keir,

On Thursday 11 October 2007 20:31:53 Keir Fraser wrote:
> Yep, that case is not acceptable for the DIV instruction, because it causes
> overflow of the quotient. It's fixed by xen-unstable changeset 16098.
>
> It's a one-char fix: the loop on (tps32 < MILLISECS(1000)) needs to be
> (tps32 <= MILLISECS(1000)).
Indeed that nicely fixes the problem.

>
>  -- Keir

Thanks,
Jean

>
> On 11/10/07 19:14, "Jean Pihet" <jpihet@xxxxxxxxxx> wrote:
> > Hi,
> >
> > The problem is in divl instruction which throws a 'Floating point
> > exception'. In the case below the dividend and the divisor are equal. Is
> > that allowed by the instruction?
> >
> > On the ARM code that we are currently implementing, there is no crash
> > =;-) but the result is 0, which does not seem correct.
> >
> > Should the assert in div_frac be changed to avoid weird results or crash?
> >
> > Regards,
> > Jean
> >
> > On Thursday 11 October 2007 19:43:08 Keir Fraser wrote:
> >> That's my code. I'll take a look!
> >>
> >>  K.
> >>
> >> On 11/10/07 16:55, "Langsdorf, Mark" <mark.langsdorf@xxxxxxx> wrote:
> >>> On my test machine, in set_time_scale(),
> >>> the following code:
> >>> ts->mul_frac = div_frac(MILLISECS(1000), tps32);
> >>> crashes with a division by zero error if
> >>> tps32 == 1000000000d.  Unfortunately, tps32 is
> >>> often that value.
> >>>
> >>> Does anyone know why this happens?  I've
> >>> resolved it temporarily by checking for
> >>> tps32 == 1000000000 and changing the
> >>> value slightly (101000010d works fine
> >>> on my test machine), but I'm not sure
> >>> if that's the approved approach for Xen.
> >>>
> >>> -Mark Langsdorf
> >>> Operating System Research Center
> >>> AMD
> >>>
> >>>
> >>>
> >>> _______________________________________________
> >>> Xen-devel mailing list
> >>> Xen-devel@xxxxxxxxxxxxxxxxxxx
> >>> http://lists.xensource.com/xen-devel
> >>
> >> _______________________________________________
> >> Xen-devel mailing list
> >> Xen-devel@xxxxxxxxxxxxxxxxxxx
> >> http://lists.xensource.com/xen-devel



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