Re: [PATCH] futex: avoid undefined behaviour when shift exponent is negative

2017-08-25 Thread zhong jiang
On 2017/8/26 5:13, Thomas Gleixner wrote: > On Fri, 25 Aug 2017, zhong jiang wrote: >> From: zhong jiang >> Date: Fri, 25 Aug 2017 12:05:56 +0800 >> Subject: [PATCH v2] futex: avoid undefined behaviour when shift exponent is >> negative > Please do not send patches without changing the subject li

Re: [PATCH] futex: avoid undefined behaviour when shift exponent is negative

2017-08-25 Thread Thomas Gleixner
On Fri, 25 Aug 2017, zhong jiang wrote: > From: zhong jiang > Date: Fri, 25 Aug 2017 12:05:56 +0800 > Subject: [PATCH v2] futex: avoid undefined behaviour when shift exponent is > negative Please do not send patches without changing the subject line so it's clear that there is a new patch. > us

Re: [PATCH] futex: avoid undefined behaviour when shift exponent is negative

2017-08-24 Thread zhong jiang
On 2017/6/29 6:13, Thomas Gleixner wrote: > On Wed, 28 Jun 2017, zhong jiang wrote: >> On 2017/6/22 0:40, Ingo Molnar wrote: >>> * zhong jiang wrote: >>> when shift expoment is negative, left shift alway zero. therefore, we modify the logic to avoid the warining. Signed-off-by:

Re: [PATCH] futex: avoid undefined behaviour when shift exponent is negative

2017-06-29 Thread zhong jiang
On 2017/6/29 14:33, Thomas Gleixner wrote: > On Thu, 29 Jun 2017, zhong jiang wrote: >> On 2017/6/29 6:13, Thomas Gleixner wrote: >>> That's simply wrong. If oparg is negative and the SHIFT bit is set then the >>> result is undefined today and there is no way that this can be used at >>> all. >>> >

Re: [PATCH] futex: avoid undefined behaviour when shift exponent is negative

2017-06-28 Thread Thomas Gleixner
On Thu, 29 Jun 2017, zhong jiang wrote: > On 2017/6/29 6:13, Thomas Gleixner wrote: > > That's simply wrong. If oparg is negative and the SHIFT bit is set then the > > result is undefined today and there is no way that this can be used at > > all. > > > > On x86: > > > >1 << -1 = 0x8000 >

Re: [PATCH] futex: avoid undefined behaviour when shift exponent is negative

2017-06-28 Thread zhong jiang
On 2017/6/29 12:29, h...@zytor.com wrote: > On June 28, 2017 7:12:04 PM PDT, zhong jiang wrote: >> On 2017/6/29 5:43, h...@zytor.com wrote: >>> On June 27, 2017 9:35:10 PM PDT, zhong jiang >> wrote: Hi, Ingo Thank you for the comment. On 2017/6/22 0:40, Ingo Molnar wrote: >>>

Re: [PATCH] futex: avoid undefined behaviour when shift exponent is negative

2017-06-28 Thread hpa
On June 28, 2017 7:12:04 PM PDT, zhong jiang wrote: >On 2017/6/29 5:43, h...@zytor.com wrote: >> On June 27, 2017 9:35:10 PM PDT, zhong jiang >wrote: >>> Hi, Ingo >>> >>> Thank you for the comment. >>> On 2017/6/22 0:40, Ingo Molnar wrote: * zhong jiang wrote: > when shift expomen

Re: [PATCH] futex: avoid undefined behaviour when shift exponent is negative

2017-06-28 Thread zhong jiang
On 2017/6/29 5:43, h...@zytor.com wrote: > On June 27, 2017 9:35:10 PM PDT, zhong jiang wrote: >> Hi, Ingo >> >> Thank you for the comment. >> On 2017/6/22 0:40, Ingo Molnar wrote: >>> * zhong jiang wrote: >>> when shift expoment is negative, left shift alway zero. therefore, >> we mod

Re: [PATCH] futex: avoid undefined behaviour when shift exponent is negative

2017-06-28 Thread zhong jiang
Hi, Thomas Thank you for clarification. On 2017/6/29 6:13, Thomas Gleixner wrote: > On Wed, 28 Jun 2017, zhong jiang wrote: >> On 2017/6/22 0:40, Ingo Molnar wrote: >>> * zhong jiang wrote: >>> when shift expoment is negative, left shift alway zero. therefore, we modify the logic to avo

Re: [PATCH] futex: avoid undefined behaviour when shift exponent is negative

2017-06-28 Thread Thomas Gleixner
On Wed, 28 Jun 2017, zhong jiang wrote: > On 2017/6/22 0:40, Ingo Molnar wrote: > > * zhong jiang wrote: > > > >> when shift expoment is negative, left shift alway zero. therefore, we > >> modify the logic to avoid the warining. > >> > >> Signed-off-by: zhong jiang > >> --- > >> arch/x86/include

Re: [PATCH] futex: avoid undefined behaviour when shift exponent is negative

2017-06-28 Thread hpa
On June 27, 2017 9:35:10 PM PDT, zhong jiang wrote: >Hi, Ingo > >Thank you for the comment. >On 2017/6/22 0:40, Ingo Molnar wrote: >> * zhong jiang wrote: >> >>> when shift expoment is negative, left shift alway zero. therefore, >we >>> modify the logic to avoid the warining. >>> >>> Signed-off-

Re: [PATCH] futex: avoid undefined behaviour when shift exponent is negative

2017-06-27 Thread zhong jiang
Hi, Ingo Thank you for the comment. On 2017/6/22 0:40, Ingo Molnar wrote: > * zhong jiang wrote: > >> when shift expoment is negative, left shift alway zero. therefore, we >> modify the logic to avoid the warining. >> >> Signed-off-by: zhong jiang >> --- >> arch/x86/include/asm/futex.h | 8 +++

Re: [PATCH] futex: avoid undefined behaviour when shift exponent is negative

2017-06-21 Thread Ingo Molnar
* zhong jiang wrote: > when shift expoment is negative, left shift alway zero. therefore, we > modify the logic to avoid the warining. > > Signed-off-by: zhong jiang > --- > arch/x86/include/asm/futex.h | 8 ++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/arch/x86