Re: [PATCH] Fix chance of sign extension to nsec after its msb is set during calculation.

2016-09-21 Thread John Stultz
On Sat, Sep 10, 2016 at 11:31 PM, Liav Rehana wrote: >>> > > During the calculation of the nsec variable, "delta * tkr->mult" >> >> > may cause overflow to the msb, if the suspended time is too long. >> >> > In that case, we need to guarantee that the variable will not go >> >> > through a sign ex

RE: [PATCH] Fix chance of sign extension to nsec after its msb is set during calculation.

2016-09-21 Thread Liav Rehana
PING -Original Message- From: Liav Rehana Sent: Sunday, September 11, 2016 9:32 AM To: 'John Stultz' ; Thomas Gleixner Cc: lkml ; Noam Camus ; Elad Kanfi Subject: RE: [PATCH] Fix chance of sign extension to nsec after its msb is set during calculation. >> > >

RE: [PATCH] Fix chance of sign extension to nsec after its msb is set during calculation.

2016-09-11 Thread Liav Rehana
>> > > During the calculation of the nsec variable, "delta * tkr->mult" > >> > may cause overflow to the msb, if the suspended time is too long. > >> > In that case, we need to guarantee that the variable will not go > >> > through a sign extension during its shift, and thus it will result > >>

Re: [PATCH] Fix chance of sign extension to nsec after its msb is set during calculation.

2016-09-06 Thread John Stultz
On Fri, Sep 2, 2016 at 11:30 AM, Thomas Gleixner wrote: > On Fri, 2 Sep 2016, Thomas Gleixner wrote: >> On Thu, 1 Sep 2016, Liav Rehana wrote: >> > From: Liav Rehana >> > >> > During the calculation of the nsec variable, "delta * tkr->mult" may cause >> > overflow to the msb, if the suspended tim

RE: [PATCH] Fix chance of sign extension to nsec after its msb is set during calculation.

2016-09-04 Thread Liav Rehana
>> The root of the problem is that in case the multiplication of delta >> and >> tkr->mult in the line that I've changed is too big that the MSB of the >> result is set, then the shift will cause an unwanted sign extension. > I completely understand that, but as I said before: > > > This typecas

RE: [PATCH] Fix chance of sign extension to nsec after its msb is set during calculation.

2016-09-04 Thread Thomas Gleixner
On Sun, 4 Sep 2016, Liav Rehana wrote: > >> The root of the problem is that in case the multiplication of delta > >> and > >> tkr->mult in the line that I've changed is too big that the MSB of the > >> result is set, then the shift will cause an unwanted sign extension. > > > I completely underst

RE: [PATCH] Fix chance of sign extension to nsec after its msb is set during calculation.

2016-09-04 Thread Thomas Gleixner
On Sun, 4 Sep 2016, Liav Rehana wrote: Please do not top post and trim your reply. > The root of the problem is that in case the multiplication of delta and > tkr->mult in the line that I've changed is too big that the MSB of the > result is set, then the shift will cause an unwanted sign extensi

RE: [PATCH] Fix chance of sign extension to nsec after its msb is set during calculation.

2016-09-04 Thread Liav Rehana
Subject: Re: [PATCH] Fix chance of sign extension to nsec after its msb is set during calculation. On Fri, 2 Sep 2016, Thomas Gleixner wrote: > On Thu, 1 Sep 2016, Liav Rehana wrote: > > From: Liav Rehana > > > > During the calculation of the nsec variable, "delta * tkr

Re: [PATCH] Fix chance of sign extension to nsec after its msb is set during calculation.

2016-09-02 Thread Thomas Gleixner
On Fri, 2 Sep 2016, Thomas Gleixner wrote: > > As a side note. John, why is that stuff unsigned at all? Shouldn't we use s/unsigned/signed/ > u64 for all of this? > > Thanks, > > tglx >

Re: [PATCH] Fix chance of sign extension to nsec after its msb is set during calculation.

2016-09-02 Thread Thomas Gleixner
On Fri, 2 Sep 2016, Thomas Gleixner wrote: > On Thu, 1 Sep 2016, Liav Rehana wrote: > > From: Liav Rehana > > > > During the calculation of the nsec variable, "delta * tkr->mult" may cause > > overflow to the msb, if the suspended time is too long. > > In that case, we need to guarantee that the

Re: [PATCH] Fix chance of sign extension to nsec after its msb is set during calculation.

2016-09-02 Thread Thomas Gleixner
On Thu, 1 Sep 2016, Liav Rehana wrote: > From: Liav Rehana > > During the calculation of the nsec variable, "delta * tkr->mult" may cause > overflow to the msb, if the suspended time is too long. > In that case, we need to guarantee that the variable will not go through a > sign extension during