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

2020-08-24 Thread Segher Boessenkool
On Mon, Aug 24, 2020 at 07:54:07PM +0800, Guohua Zhong wrote: > >> 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 > >

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

2020-08-24 Thread David Laight
From: Guohua Zhong > Sent: 24 August 2020 14:26 > > >> >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/div

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 S

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

2020-08-22 Thread Segher Boessenkool
On Sun, Aug 23, 2020 at 12:54:33AM +0800, Guohua Zhong wrote: > 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

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

2020-08-22 Thread Gabriel Paubert
On Sun, Aug 23, 2020 at 12:54:33AM +0800, Guohua Zhong wrote: > >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

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
>> When cat /proc/pid/stat, do_task_stat will call into cputime_adjust, >> which call stack is like this: >> >> [17179954.674326]BookE Watchdog detected hard LOCKUP on cpu 0 >> [17179954.674331]dCPU: 0 PID: 1262 Comm: TICK Tainted: PW O >> 4.4.176 #1 >> [17179954.674339]dtask: dc9d704

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

2020-08-22 Thread Guohua Zhong
>> When cat /proc/pid/stat, do_task_stat will call into cputime_adjust, >> which call stack is like this: >> >> [17179954.674326]BookE Watchdog detected hard LOCKUP on cpu 0 >> [17179954.674331]dCPU: 0 PID: 1262 Comm: TICK Tainted: PW O >> 4.4.176 #1 >> [17179954.674339]dtask: dc9d704

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

2020-08-20 Thread Christophe Leroy
Le 20/08/2020 à 15:10, Guohua Zhong a écrit : When cat /proc/pid/stat, do_task_stat will call into cputime_adjust, which call stack is like this: [17179954.674326]BookE Watchdog detected hard LOCKUP on cpu 0 [17179954.674331]dCPU: 0 PID: 1262 Comm: TICK Tainted: PW O4.4.176 #1 [

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

2020-08-20 Thread Christophe Leroy
Le 20/08/2020 à 15:10, Guohua Zhong a écrit : When cat /proc/pid/stat, do_task_stat will call into cputime_adjust, which call stack is like this: [17179954.674326]BookE Watchdog detected hard LOCKUP on cpu 0 [17179954.674331]dCPU: 0 PID: 1262 Comm: TICK Tainted: PW O4.4.176 #1 [

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

2020-08-20 Thread Guohua Zhong
When cat /proc/pid/stat, do_task_stat will call into cputime_adjust, which call stack is like this: [17179954.674326]BookE Watchdog detected hard LOCKUP on cpu 0 [17179954.674331]dCPU: 0 PID: 1262 Comm: TICK Tainted: PW O4.4.176 #1 [17179954.674339]dtask: dc9d7040 task.stack: d3cb400