Re: [PATCH] powerpc/bug: Cast to unsigned long before passing to inline asm

2021-09-01 Thread Segher Boessenkool
On Wed, Sep 01, 2021 at 05:17:26PM +1000, Michael Ellerman wrote: > Segher Boessenkool writes: > > On Tue, Aug 31, 2021 at 11:27:20PM +1000, Michael Ellerman wrote: > >> Nathan filed an LLVM bug [2], in which Eli Friedman explained that "if > >> you pass a value of a type that's narrower than a re

Re: [PATCH] powerpc/bug: Cast to unsigned long before passing to inline asm

2021-09-01 Thread Michael Ellerman
Segher Boessenkool writes: > On Tue, Aug 31, 2021 at 11:27:20PM +1000, Michael Ellerman wrote: >> Nathan filed an LLVM bug [2], in which Eli Friedman explained that "if >> you pass a value of a type that's narrower than a register to an inline >> asm, the high bits are undefined". In this case we

Re: [PATCH] powerpc/bug: Cast to unsigned long before passing to inline asm

2021-08-31 Thread Segher Boessenkool
Hi! On Tue, Aug 31, 2021 at 11:27:20PM +1000, Michael Ellerman wrote: > Nathan filed an LLVM bug [2], in which Eli Friedman explained that "if > you pass a value of a type that's narrower than a register to an inline > asm, the high bits are undefined". In this case we are passing a bool > to the

Re: [PATCH] powerpc/bug: Cast to unsigned long before passing to inline asm

2021-08-31 Thread Nathan Chancellor
On Tue, Aug 31, 2021 at 11:27:20PM +1000, Michael Ellerman wrote: > In commit 1e688dd2a3d6 ("powerpc/bug: Provide better flexibility to > WARN_ON/__WARN_FLAGS() with asm goto") we changed WARN_ON(). Previously > it would take the warning condition, x, and double negate it before > converting the re

[PATCH] powerpc/bug: Cast to unsigned long before passing to inline asm

2021-08-31 Thread Michael Ellerman
In commit 1e688dd2a3d6 ("powerpc/bug: Provide better flexibility to WARN_ON/__WARN_FLAGS() with asm goto") we changed WARN_ON(). Previously it would take the warning condition, x, and double negate it before converting the result to int, and passing that int to the underlying inline asm. ie: #de