Re: [PATCH v3 0/6] locking/rwsem/x86: Add stack frame dependency for some inline asm

2017-09-25 Thread Miguel Bernal Marin
On Mon, Sep 25, 2017 at 02:03:21PM -0500, Josh Poimboeuf wrote:
> On Mon, Sep 25, 2017 at 02:00:43PM -0500, Josh Poimboeuf wrote:
> > On Mon, Sep 25, 2017 at 12:34:19PM -0500, Miguel Bernal Marin wrote:
> > > On Wed, Sep 20, 2017 at 04:24:18PM -0500, Josh Poimboeuf wrote:
> > > > On Tue, Sep 19, 2017 at 06:37:39PM -0500, Miguel Bernal Marin wrote:
> > > > > Some warning were showed by objtool using gcc 7.2.0
> > > > > 
> > > > > kernel/locking/rwsem.o: warning: objtool: up_read()+0x11: call 
> > > > > without frame pointer save/setup
> > > > > kernel/locking/rwsem.o: warning: objtool: up_write()+0x17: call 
> > > > > without frame pointer save/setup
> > > > > kernel/locking/rwsem.o: warning: objtool: downgrade_write()+0x22: 
> > > > > call without frame pointer save/setup
> > > > > 
> > > > > which means gcc placed an inline asm function and its call 
> > > > > instruction before
> > > > > the frame pointer setup.
> > > > >  
> > > > > This series forces a stack frame to be created before the call 
> > > > > instruction
> > > > > by listing the stack pointer as an output operand in the inline asm 
> > > > > statement.
> > > > > 
> > > > > Also to be easy to maintain and understand the operands from the 
> > > > > extended
> > > > > assembler instructions were converted to named operands.
> > > > 
> > > > I've got a patch going around which will change the way we do this, so
> > > > you'll probably need to do a v3 after my patch gets merged.  I'll add
> > > > you to cc for the next revision.
> > > > 
> > > 
> > > With your new patches (at v4.14.-rc2) the warning is not seen any more,
> > > so I will send only the named operand patches (in separate thread), as
> > > this fix is not more needed.
> > 
> > Any chance you tested with GCC 7?  With GCC 6 and older you might still
> > see the warnings.
> 
> Sorry, reading again it looks like your warnings only started showing up
> in GCC 7.2.0?  If so, then it does make sense that your fix isn't needed
> any more, because my patch fixed this issue for *all* inline asm for GCC
> 7+.
> 

Yes it was with GCC 7.2.0


> -- 
> Josh

-- 
Regards,

Miguel Bernal Marin Open Source Technology Center
https://clearlinux.org  Intel Corporation


Re: [PATCH v3 0/6] locking/rwsem/x86: Add stack frame dependency for some inline asm

2017-09-25 Thread Miguel Bernal Marin
On Mon, Sep 25, 2017 at 02:03:21PM -0500, Josh Poimboeuf wrote:
> On Mon, Sep 25, 2017 at 02:00:43PM -0500, Josh Poimboeuf wrote:
> > On Mon, Sep 25, 2017 at 12:34:19PM -0500, Miguel Bernal Marin wrote:
> > > On Wed, Sep 20, 2017 at 04:24:18PM -0500, Josh Poimboeuf wrote:
> > > > On Tue, Sep 19, 2017 at 06:37:39PM -0500, Miguel Bernal Marin wrote:
> > > > > Some warning were showed by objtool using gcc 7.2.0
> > > > > 
> > > > > kernel/locking/rwsem.o: warning: objtool: up_read()+0x11: call 
> > > > > without frame pointer save/setup
> > > > > kernel/locking/rwsem.o: warning: objtool: up_write()+0x17: call 
> > > > > without frame pointer save/setup
> > > > > kernel/locking/rwsem.o: warning: objtool: downgrade_write()+0x22: 
> > > > > call without frame pointer save/setup
> > > > > 
> > > > > which means gcc placed an inline asm function and its call 
> > > > > instruction before
> > > > > the frame pointer setup.
> > > > >  
> > > > > This series forces a stack frame to be created before the call 
> > > > > instruction
> > > > > by listing the stack pointer as an output operand in the inline asm 
> > > > > statement.
> > > > > 
> > > > > Also to be easy to maintain and understand the operands from the 
> > > > > extended
> > > > > assembler instructions were converted to named operands.
> > > > 
> > > > I've got a patch going around which will change the way we do this, so
> > > > you'll probably need to do a v3 after my patch gets merged.  I'll add
> > > > you to cc for the next revision.
> > > > 
> > > 
> > > With your new patches (at v4.14.-rc2) the warning is not seen any more,
> > > so I will send only the named operand patches (in separate thread), as
> > > this fix is not more needed.
> > 
> > Any chance you tested with GCC 7?  With GCC 6 and older you might still
> > see the warnings.
> 
> Sorry, reading again it looks like your warnings only started showing up
> in GCC 7.2.0?  If so, then it does make sense that your fix isn't needed
> any more, because my patch fixed this issue for *all* inline asm for GCC
> 7+.
> 

Yes it was with GCC 7.2.0


> -- 
> Josh

-- 
Regards,

Miguel Bernal Marin Open Source Technology Center
https://clearlinux.org  Intel Corporation


Re: [PATCH v3 0/6] locking/rwsem/x86: Add stack frame dependency for some inline asm

2017-09-25 Thread Josh Poimboeuf
On Mon, Sep 25, 2017 at 02:00:43PM -0500, Josh Poimboeuf wrote:
> On Mon, Sep 25, 2017 at 12:34:19PM -0500, Miguel Bernal Marin wrote:
> > On Wed, Sep 20, 2017 at 04:24:18PM -0500, Josh Poimboeuf wrote:
> > > On Tue, Sep 19, 2017 at 06:37:39PM -0500, Miguel Bernal Marin wrote:
> > > > Some warning were showed by objtool using gcc 7.2.0
> > > > 
> > > > kernel/locking/rwsem.o: warning: objtool: up_read()+0x11: call without 
> > > > frame pointer save/setup
> > > > kernel/locking/rwsem.o: warning: objtool: up_write()+0x17: call without 
> > > > frame pointer save/setup
> > > > kernel/locking/rwsem.o: warning: objtool: downgrade_write()+0x22: call 
> > > > without frame pointer save/setup
> > > > 
> > > > which means gcc placed an inline asm function and its call instruction 
> > > > before
> > > > the frame pointer setup.
> > > >  
> > > > This series forces a stack frame to be created before the call 
> > > > instruction
> > > > by listing the stack pointer as an output operand in the inline asm 
> > > > statement.
> > > > 
> > > > Also to be easy to maintain and understand the operands from the 
> > > > extended
> > > > assembler instructions were converted to named operands.
> > > 
> > > I've got a patch going around which will change the way we do this, so
> > > you'll probably need to do a v3 after my patch gets merged.  I'll add
> > > you to cc for the next revision.
> > > 
> > 
> > With your new patches (at v4.14.-rc2) the warning is not seen any more,
> > so I will send only the named operand patches (in separate thread), as
> > this fix is not more needed.
> 
> Any chance you tested with GCC 7?  With GCC 6 and older you might still
> see the warnings.

Sorry, reading again it looks like your warnings only started showing up
in GCC 7.2.0?  If so, then it does make sense that your fix isn't needed
any more, because my patch fixed this issue for *all* inline asm for GCC
7+.

-- 
Josh


Re: [PATCH v3 0/6] locking/rwsem/x86: Add stack frame dependency for some inline asm

2017-09-25 Thread Josh Poimboeuf
On Mon, Sep 25, 2017 at 02:00:43PM -0500, Josh Poimboeuf wrote:
> On Mon, Sep 25, 2017 at 12:34:19PM -0500, Miguel Bernal Marin wrote:
> > On Wed, Sep 20, 2017 at 04:24:18PM -0500, Josh Poimboeuf wrote:
> > > On Tue, Sep 19, 2017 at 06:37:39PM -0500, Miguel Bernal Marin wrote:
> > > > Some warning were showed by objtool using gcc 7.2.0
> > > > 
> > > > kernel/locking/rwsem.o: warning: objtool: up_read()+0x11: call without 
> > > > frame pointer save/setup
> > > > kernel/locking/rwsem.o: warning: objtool: up_write()+0x17: call without 
> > > > frame pointer save/setup
> > > > kernel/locking/rwsem.o: warning: objtool: downgrade_write()+0x22: call 
> > > > without frame pointer save/setup
> > > > 
> > > > which means gcc placed an inline asm function and its call instruction 
> > > > before
> > > > the frame pointer setup.
> > > >  
> > > > This series forces a stack frame to be created before the call 
> > > > instruction
> > > > by listing the stack pointer as an output operand in the inline asm 
> > > > statement.
> > > > 
> > > > Also to be easy to maintain and understand the operands from the 
> > > > extended
> > > > assembler instructions were converted to named operands.
> > > 
> > > I've got a patch going around which will change the way we do this, so
> > > you'll probably need to do a v3 after my patch gets merged.  I'll add
> > > you to cc for the next revision.
> > > 
> > 
> > With your new patches (at v4.14.-rc2) the warning is not seen any more,
> > so I will send only the named operand patches (in separate thread), as
> > this fix is not more needed.
> 
> Any chance you tested with GCC 7?  With GCC 6 and older you might still
> see the warnings.

Sorry, reading again it looks like your warnings only started showing up
in GCC 7.2.0?  If so, then it does make sense that your fix isn't needed
any more, because my patch fixed this issue for *all* inline asm for GCC
7+.

-- 
Josh


Re: [PATCH v3 0/6] locking/rwsem/x86: Add stack frame dependency for some inline asm

2017-09-25 Thread Josh Poimboeuf
On Mon, Sep 25, 2017 at 12:34:19PM -0500, Miguel Bernal Marin wrote:
> On Wed, Sep 20, 2017 at 04:24:18PM -0500, Josh Poimboeuf wrote:
> > On Tue, Sep 19, 2017 at 06:37:39PM -0500, Miguel Bernal Marin wrote:
> > > Some warning were showed by objtool using gcc 7.2.0
> > > 
> > > kernel/locking/rwsem.o: warning: objtool: up_read()+0x11: call without 
> > > frame pointer save/setup
> > > kernel/locking/rwsem.o: warning: objtool: up_write()+0x17: call without 
> > > frame pointer save/setup
> > > kernel/locking/rwsem.o: warning: objtool: downgrade_write()+0x22: call 
> > > without frame pointer save/setup
> > > 
> > > which means gcc placed an inline asm function and its call instruction 
> > > before
> > > the frame pointer setup.
> > >  
> > > This series forces a stack frame to be created before the call instruction
> > > by listing the stack pointer as an output operand in the inline asm 
> > > statement.
> > > 
> > > Also to be easy to maintain and understand the operands from the extended
> > > assembler instructions were converted to named operands.
> > 
> > I've got a patch going around which will change the way we do this, so
> > you'll probably need to do a v3 after my patch gets merged.  I'll add
> > you to cc for the next revision.
> > 
> 
> With your new patches (at v4.14.-rc2) the warning is not seen any more,
> so I will send only the named operand patches (in separate thread), as
> this fix is not more needed.

Any chance you tested with GCC 7?  With GCC 6 and older you might still
see the warnings.

-- 
Josh


Re: [PATCH v3 0/6] locking/rwsem/x86: Add stack frame dependency for some inline asm

2017-09-25 Thread Josh Poimboeuf
On Mon, Sep 25, 2017 at 12:34:19PM -0500, Miguel Bernal Marin wrote:
> On Wed, Sep 20, 2017 at 04:24:18PM -0500, Josh Poimboeuf wrote:
> > On Tue, Sep 19, 2017 at 06:37:39PM -0500, Miguel Bernal Marin wrote:
> > > Some warning were showed by objtool using gcc 7.2.0
> > > 
> > > kernel/locking/rwsem.o: warning: objtool: up_read()+0x11: call without 
> > > frame pointer save/setup
> > > kernel/locking/rwsem.o: warning: objtool: up_write()+0x17: call without 
> > > frame pointer save/setup
> > > kernel/locking/rwsem.o: warning: objtool: downgrade_write()+0x22: call 
> > > without frame pointer save/setup
> > > 
> > > which means gcc placed an inline asm function and its call instruction 
> > > before
> > > the frame pointer setup.
> > >  
> > > This series forces a stack frame to be created before the call instruction
> > > by listing the stack pointer as an output operand in the inline asm 
> > > statement.
> > > 
> > > Also to be easy to maintain and understand the operands from the extended
> > > assembler instructions were converted to named operands.
> > 
> > I've got a patch going around which will change the way we do this, so
> > you'll probably need to do a v3 after my patch gets merged.  I'll add
> > you to cc for the next revision.
> > 
> 
> With your new patches (at v4.14.-rc2) the warning is not seen any more,
> so I will send only the named operand patches (in separate thread), as
> this fix is not more needed.

Any chance you tested with GCC 7?  With GCC 6 and older you might still
see the warnings.

-- 
Josh


Re: [PATCH v3 0/6] locking/rwsem/x86: Add stack frame dependency for some inline asm

2017-09-25 Thread Miguel Bernal Marin
On Wed, Sep 20, 2017 at 04:24:18PM -0500, Josh Poimboeuf wrote:
> On Tue, Sep 19, 2017 at 06:37:39PM -0500, Miguel Bernal Marin wrote:
> > Some warning were showed by objtool using gcc 7.2.0
> > 
> > kernel/locking/rwsem.o: warning: objtool: up_read()+0x11: call without 
> > frame pointer save/setup
> > kernel/locking/rwsem.o: warning: objtool: up_write()+0x17: call without 
> > frame pointer save/setup
> > kernel/locking/rwsem.o: warning: objtool: downgrade_write()+0x22: call 
> > without frame pointer save/setup
> > 
> > which means gcc placed an inline asm function and its call instruction 
> > before
> > the frame pointer setup.
> >  
> > This series forces a stack frame to be created before the call instruction
> > by listing the stack pointer as an output operand in the inline asm 
> > statement.
> > 
> > Also to be easy to maintain and understand the operands from the extended
> > assembler instructions were converted to named operands.
> 
> I've got a patch going around which will change the way we do this, so
> you'll probably need to do a v3 after my patch gets merged.  I'll add
> you to cc for the next revision.
> 

With your new patches (at v4.14.-rc2) the warning is not seen any more,
so I will send only the named operand patches (in separate thread), as
this fix is not more needed.


> -- 
> Josh

-- 
Regards,

Miguel Bernal Marin Open Source Technology Center
https://clearlinux.org  Intel Corporation


Re: [PATCH v3 0/6] locking/rwsem/x86: Add stack frame dependency for some inline asm

2017-09-25 Thread Miguel Bernal Marin
On Wed, Sep 20, 2017 at 04:24:18PM -0500, Josh Poimboeuf wrote:
> On Tue, Sep 19, 2017 at 06:37:39PM -0500, Miguel Bernal Marin wrote:
> > Some warning were showed by objtool using gcc 7.2.0
> > 
> > kernel/locking/rwsem.o: warning: objtool: up_read()+0x11: call without 
> > frame pointer save/setup
> > kernel/locking/rwsem.o: warning: objtool: up_write()+0x17: call without 
> > frame pointer save/setup
> > kernel/locking/rwsem.o: warning: objtool: downgrade_write()+0x22: call 
> > without frame pointer save/setup
> > 
> > which means gcc placed an inline asm function and its call instruction 
> > before
> > the frame pointer setup.
> >  
> > This series forces a stack frame to be created before the call instruction
> > by listing the stack pointer as an output operand in the inline asm 
> > statement.
> > 
> > Also to be easy to maintain and understand the operands from the extended
> > assembler instructions were converted to named operands.
> 
> I've got a patch going around which will change the way we do this, so
> you'll probably need to do a v3 after my patch gets merged.  I'll add
> you to cc for the next revision.
> 

With your new patches (at v4.14.-rc2) the warning is not seen any more,
so I will send only the named operand patches (in separate thread), as
this fix is not more needed.


> -- 
> Josh

-- 
Regards,

Miguel Bernal Marin Open Source Technology Center
https://clearlinux.org  Intel Corporation


Re: [PATCH v3 0/6] locking/rwsem/x86: Add stack frame dependency for some inline asm

2017-09-21 Thread Miguel Bernal Marin
On Wed, Sep 20, 2017 at 04:24:18PM -0500, Josh Poimboeuf wrote:
> On Tue, Sep 19, 2017 at 06:37:39PM -0500, Miguel Bernal Marin wrote:
> > Some warning were showed by objtool using gcc 7.2.0
> > 
> > kernel/locking/rwsem.o: warning: objtool: up_read()+0x11: call without 
> > frame pointer save/setup
> > kernel/locking/rwsem.o: warning: objtool: up_write()+0x17: call without 
> > frame pointer save/setup
> > kernel/locking/rwsem.o: warning: objtool: downgrade_write()+0x22: call 
> > without frame pointer save/setup
> > 
> > which means gcc placed an inline asm function and its call instruction 
> > before
> > the frame pointer setup.
> >  
> > This series forces a stack frame to be created before the call instruction
> > by listing the stack pointer as an output operand in the inline asm 
> > statement.
> > 
> > Also to be easy to maintain and understand the operands from the extended
> > assembler instructions were converted to named operands.
> 
> I've got a patch going around which will change the way we do this, so
> you'll probably need to do a v3 after my patch gets merged.  I'll add
> you to cc for the next revision.
> 

Ok, I will wait to see your changes merged.

Thanks.


> -- 
> Josh

-- 
Regards,

Miguel Bernal Marin Open Source Technology Center
https://clearlinux.org  Intel Corporation


Re: [PATCH v3 0/6] locking/rwsem/x86: Add stack frame dependency for some inline asm

2017-09-21 Thread Miguel Bernal Marin
On Wed, Sep 20, 2017 at 04:24:18PM -0500, Josh Poimboeuf wrote:
> On Tue, Sep 19, 2017 at 06:37:39PM -0500, Miguel Bernal Marin wrote:
> > Some warning were showed by objtool using gcc 7.2.0
> > 
> > kernel/locking/rwsem.o: warning: objtool: up_read()+0x11: call without 
> > frame pointer save/setup
> > kernel/locking/rwsem.o: warning: objtool: up_write()+0x17: call without 
> > frame pointer save/setup
> > kernel/locking/rwsem.o: warning: objtool: downgrade_write()+0x22: call 
> > without frame pointer save/setup
> > 
> > which means gcc placed an inline asm function and its call instruction 
> > before
> > the frame pointer setup.
> >  
> > This series forces a stack frame to be created before the call instruction
> > by listing the stack pointer as an output operand in the inline asm 
> > statement.
> > 
> > Also to be easy to maintain and understand the operands from the extended
> > assembler instructions were converted to named operands.
> 
> I've got a patch going around which will change the way we do this, so
> you'll probably need to do a v3 after my patch gets merged.  I'll add
> you to cc for the next revision.
> 

Ok, I will wait to see your changes merged.

Thanks.


> -- 
> Josh

-- 
Regards,

Miguel Bernal Marin Open Source Technology Center
https://clearlinux.org  Intel Corporation


Re: [PATCH v3 0/6] locking/rwsem/x86: Add stack frame dependency for some inline asm

2017-09-20 Thread Josh Poimboeuf
On Tue, Sep 19, 2017 at 06:37:39PM -0500, Miguel Bernal Marin wrote:
> Some warning were showed by objtool using gcc 7.2.0
> 
> kernel/locking/rwsem.o: warning: objtool: up_read()+0x11: call without frame 
> pointer save/setup
> kernel/locking/rwsem.o: warning: objtool: up_write()+0x17: call without frame 
> pointer save/setup
> kernel/locking/rwsem.o: warning: objtool: downgrade_write()+0x22: call 
> without frame pointer save/setup
> 
> which means gcc placed an inline asm function and its call instruction before
> the frame pointer setup.
>  
> This series forces a stack frame to be created before the call instruction
> by listing the stack pointer as an output operand in the inline asm statement.
> 
> Also to be easy to maintain and understand the operands from the extended
> assembler instructions were converted to named operands.

I've got a patch going around which will change the way we do this, so
you'll probably need to do a v3 after my patch gets merged.  I'll add
you to cc for the next revision.

-- 
Josh


Re: [PATCH v3 0/6] locking/rwsem/x86: Add stack frame dependency for some inline asm

2017-09-20 Thread Josh Poimboeuf
On Tue, Sep 19, 2017 at 06:37:39PM -0500, Miguel Bernal Marin wrote:
> Some warning were showed by objtool using gcc 7.2.0
> 
> kernel/locking/rwsem.o: warning: objtool: up_read()+0x11: call without frame 
> pointer save/setup
> kernel/locking/rwsem.o: warning: objtool: up_write()+0x17: call without frame 
> pointer save/setup
> kernel/locking/rwsem.o: warning: objtool: downgrade_write()+0x22: call 
> without frame pointer save/setup
> 
> which means gcc placed an inline asm function and its call instruction before
> the frame pointer setup.
>  
> This series forces a stack frame to be created before the call instruction
> by listing the stack pointer as an output operand in the inline asm statement.
> 
> Also to be easy to maintain and understand the operands from the extended
> assembler instructions were converted to named operands.

I've got a patch going around which will change the way we do this, so
you'll probably need to do a v3 after my patch gets merged.  I'll add
you to cc for the next revision.

-- 
Josh


[PATCH v3 0/6] locking/rwsem/x86: Add stack frame dependency for some inline asm

2017-09-19 Thread Miguel Bernal Marin
Some warning were showed by objtool using gcc 7.2.0

kernel/locking/rwsem.o: warning: objtool: up_read()+0x11: call without frame 
pointer save/setup
kernel/locking/rwsem.o: warning: objtool: up_write()+0x17: call without frame 
pointer save/setup
kernel/locking/rwsem.o: warning: objtool: downgrade_write()+0x22: call without 
frame pointer save/setup

which means gcc placed an inline asm function and its call instruction before
the frame pointer setup.
 
This series forces a stack frame to be created before the call instruction
by listing the stack pointer as an output operand in the inline asm statement.

Also to be easy to maintain and understand the operands from the extended
assembler instructions were converted to named operands.

Changes in v3:
  - Convert to named operands

Changes in v2:
  - Update first parameter from _ASM_ADD to '%3' at __downgrade_write()


Miguel Bernal Marin (6):
  locking/rwsem/x86: Add stack frame dependency for __up_read()
  locking/rwsem/x86: Add stack frame dependency for __up_write()
  locking/rwsem/x86: Add stack frame dependency for __downgrade_write()
  x86, asm/rwsem: Use named operands in __up_read()
  x86, asm/rwsem: Use named operands in __up_write()
  x86, asm/rwsem: Use named operands in __downgrade_write()

 arch/x86/include/asm/rwsem.h | 24 +++-
 1 file changed, 15 insertions(+), 9 deletions(-)

-- 
2.14.1



[PATCH v3 0/6] locking/rwsem/x86: Add stack frame dependency for some inline asm

2017-09-19 Thread Miguel Bernal Marin
Some warning were showed by objtool using gcc 7.2.0

kernel/locking/rwsem.o: warning: objtool: up_read()+0x11: call without frame 
pointer save/setup
kernel/locking/rwsem.o: warning: objtool: up_write()+0x17: call without frame 
pointer save/setup
kernel/locking/rwsem.o: warning: objtool: downgrade_write()+0x22: call without 
frame pointer save/setup

which means gcc placed an inline asm function and its call instruction before
the frame pointer setup.
 
This series forces a stack frame to be created before the call instruction
by listing the stack pointer as an output operand in the inline asm statement.

Also to be easy to maintain and understand the operands from the extended
assembler instructions were converted to named operands.

Changes in v3:
  - Convert to named operands

Changes in v2:
  - Update first parameter from _ASM_ADD to '%3' at __downgrade_write()


Miguel Bernal Marin (6):
  locking/rwsem/x86: Add stack frame dependency for __up_read()
  locking/rwsem/x86: Add stack frame dependency for __up_write()
  locking/rwsem/x86: Add stack frame dependency for __downgrade_write()
  x86, asm/rwsem: Use named operands in __up_read()
  x86, asm/rwsem: Use named operands in __up_write()
  x86, asm/rwsem: Use named operands in __downgrade_write()

 arch/x86/include/asm/rwsem.h | 24 +++-
 1 file changed, 15 insertions(+), 9 deletions(-)

-- 
2.14.1