Re: [RESEND,PATCH] ARM: fix __div64_32() error when compiling with clang

2020-11-30 Thread Ard Biesheuvel
On Mon, 30 Nov 2020 at 18:52, Nicolas Pitre wrote: > > On Mon, 30 Nov 2020, Ard Biesheuvel wrote: > > > On Mon, 30 Nov 2020 at 16:51, Nicolas Pitre wrote: > > > > > Here's my version of the fix which should be correct. Warning: this > > > is completely untested, but should in theory produce the

Re: [RESEND,PATCH] ARM: fix __div64_32() error when compiling with clang

2020-11-30 Thread Nicolas Pitre
On Mon, 30 Nov 2020, Ard Biesheuvel wrote: > On Mon, 30 Nov 2020 at 16:51, Nicolas Pitre wrote: > > > Here's my version of the fix which should be correct. Warning: this > > is completely untested, but should in theory produce the same code on > > modern gcc. > > > > diff --git

Re: [RESEND,PATCH] ARM: fix __div64_32() error when compiling with clang

2020-11-30 Thread Ard Biesheuvel
On Mon, 30 Nov 2020 at 16:51, Nicolas Pitre wrote: > > On Mon, 30 Nov 2020, Ard Biesheuvel wrote: > > > (+ Nico) > > > > On Mon, 30 Nov 2020 at 11:11, Ard Biesheuvel wrote: > > > > > > On Mon, 23 Nov 2020 at 08:39, Antony Yu wrote: > > > > > > > > __do_div64 clobbers the input register r0 in

Re: [RESEND,PATCH] ARM: fix __div64_32() error when compiling with clang

2020-11-30 Thread Nicolas Pitre
On Mon, 30 Nov 2020, Ard Biesheuvel wrote: > (+ Nico) > > On Mon, 30 Nov 2020 at 11:11, Ard Biesheuvel wrote: > > > > On Mon, 23 Nov 2020 at 08:39, Antony Yu wrote: > > > > > > __do_div64 clobbers the input register r0 in little endian system. > > > According to the inline assembly document,

Re: [RESEND,PATCH] ARM: fix __div64_32() error when compiling with clang

2020-11-30 Thread Russell King - ARM Linux admin
On Mon, Nov 30, 2020 at 01:58:27PM +, David Laight wrote: > > And actually, the same applies on BE, but the other way around. So we > > should mark __xl as an output register as well, as __xl will assume > > the right value depending on the endianness. > > Why not use "+r" to indicate than an

RE: [RESEND,PATCH] ARM: fix __div64_32() error when compiling with clang

2020-11-30 Thread David Laight
> And actually, the same applies on BE, but the other way around. So we > should mark __xl as an output register as well, as __xl will assume > the right value depending on the endianness. Why not use "+r" to indicate than an 'output' parameter is also used as an input. Rather cleaner than

Re: [RESEND,PATCH] ARM: fix __div64_32() error when compiling with clang

2020-11-30 Thread Ard Biesheuvel
On Mon, 30 Nov 2020 at 11:21, Russell King - ARM Linux admin wrote: > > On Mon, Nov 30, 2020 at 11:12:33AM +0100, Ard Biesheuvel wrote: > > (+ Nico) > > > > On Mon, 30 Nov 2020 at 11:11, Ard Biesheuvel wrote: > > > > > > On Mon, 23 Nov 2020 at 08:39, Antony Yu wrote: > > > > > > > > __do_div64

Re: [RESEND,PATCH] ARM: fix __div64_32() error when compiling with clang

2020-11-30 Thread Russell King - ARM Linux admin
On Mon, Nov 30, 2020 at 11:12:33AM +0100, Ard Biesheuvel wrote: > (+ Nico) > > On Mon, 30 Nov 2020 at 11:11, Ard Biesheuvel wrote: > > > > On Mon, 23 Nov 2020 at 08:39, Antony Yu wrote: > > > > > > __do_div64 clobbers the input register r0 in little endian system. > > > According to the inline

Re: [RESEND,PATCH] ARM: fix __div64_32() error when compiling with clang

2020-11-30 Thread Ard Biesheuvel
On Mon, 23 Nov 2020 at 08:39, Antony Yu wrote: > > __do_div64 clobbers the input register r0 in little endian system. > According to the inline assembly document, if an input operand is > modified, it should be tied to a output operand. This patch can > prevent compilers from reusing r0 register

Re: [RESEND,PATCH] ARM: fix __div64_32() error when compiling with clang

2020-11-30 Thread Ard Biesheuvel
(+ Nico) On Mon, 30 Nov 2020 at 11:11, Ard Biesheuvel wrote: > > On Mon, 23 Nov 2020 at 08:39, Antony Yu wrote: > > > > __do_div64 clobbers the input register r0 in little endian system. > > According to the inline assembly document, if an input operand is > > modified, it should be tied to a

Re: [RESEND,PATCH] ARM: fix __div64_32() error when compiling with clang

2020-11-24 Thread kernel test robot
Hi Antony, Thank you for the patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v5.10-rc5 next-20201124] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in

Re: [RESEND,PATCH] ARM: fix __div64_32() error when compiling with clang

2020-11-24 Thread Nick Desaulniers
Thanks for the report, it probably was not fun to debug. I'll take a closer look at this after the Thanksgiving holiday. On Tue, Nov 24, 2020 at 2:14 AM Antony Yu wrote: > > Antony Yu 於 2020年11月24日 週二 下午3:43寫道: > > > > On Mon, Nov 23, 2020 at 11:16:02AM -0700, Nathan Chancellor wrote: > > > On

Re: [RESEND,PATCH] ARM: fix __div64_32() error when compiling with clang

2020-11-24 Thread Antony Yu
Antony Yu 於 2020年11月24日 週二 下午3:43寫道: > > On Mon, Nov 23, 2020 at 11:16:02AM -0700, Nathan Chancellor wrote: > > On Mon, Nov 23, 2020 at 03:36:32PM +0800, Antony Yu wrote: > > > __do_div64 clobbers the input register r0 in little endian system. > > > According to the inline assembly document, if

Re: [RESEND,PATCH] ARM: fix __div64_32() error when compiling with clang

2020-11-23 Thread Nathan Chancellor
On Mon, Nov 23, 2020 at 03:36:32PM +0800, Antony Yu wrote: > __do_div64 clobbers the input register r0 in little endian system. > According to the inline assembly document, if an input operand is > modified, it should be tied to a output operand. This patch can > prevent compilers from reusing r0