Re: Re:Re: [PATCH] powerpc: Fix a bug in __div64_32 if divisor is zero

2020-08-24 Thread Guohua Zhong
>> >In generic version in lib/math/div64.c, there is no checking of 'base' >> >either. >> >Do we really want to add this check in the powerpc version only ? >> >> >The only user of __div64_32() is do_div() in >> >include/asm-generic/div64.h. Wouldn't it be better to do the check there ? >> >>

Re: Re:Re: [PATCH] powerpc: Fix a bug in __div64_32 if divisor is zero

2020-08-24 Thread Guohua Zhong
>> Yet, I have noticed that there is no checking of 'base' in these functions. >> But I am not sure how to check is better.As we know that the result is >> undefined when divisor is zero. It maybe good to print error and dump stack. >> Let the process to know that the divisor is zero by sending

Re:Re: [PATCH] powerpc: Fix a bug in __div64_32 if divisor is zero

2020-08-22 Thread Guohua Zhong
>In generic version in lib/math/div64.c, there is no checking of 'base' >either. >Do we really want to add this check in the powerpc version only ? >The only user of __div64_32() is do_div() in >include/asm-generic/div64.h. Wouldn't it be better to do the check there ? >Christophe Yet, I have

Re: [PATCH] powerpc: Fix a bug in __div64_32 if divisor is zero

2020-08-22 Thread Guohua Zhong
xists. >> >> So it is also a bug in the cputime_adjust which does not check if >> stime + utime = 0 >> >> time = scale_stime((__force u64)stime, (__force u64)rtime, >> (__force u64)(stime + utime)); >> >> The commit 3dc167ba5729

Re: [PATCH] powerpc: Fix a bug in __div64_32 if divisor is zero

2020-08-22 Thread Guohua Zhong
xists. >> >> So it is also a bug in the cputime_adjust which does not check if >> stime + utime = 0 >> >> time = scale_stime((__force u64)stime, (__force u64)rtime, >> (__force u64)(stime + utime)); >> >> The commit 3dc167ba5729

[PATCH] powerpc: Fix a bug in __div64_32 if divisor is zero

2020-08-20 Thread Guohua Zhong
or other situation. Signed-off-by: Guohua Zhong Fixes:14cf11af6cf6 "( powerpc: Merge enough to start building in arch/powerpc.)" Fixes:94b212c29f68 "( powerpc: Move ppc64 boot wrapper code over to arch/powerpc)" Cc: sta...@vger.kernel.org # v2.6.15+ --- arch/powerpc/boot/div6