linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] trace: fix SKIP_STACK_VALIDATION=1 build
@ 2018-06-08 21:47 Greg Thelen
  2018-06-08 22:08 ` Andi Kleen
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Greg Thelen @ 2018-06-08 21:47 UTC (permalink / raw)
  To: Andi Kleen, Steven Rostedt
  Cc: linux-kernel, x86, linux-kbuild, akpm, Andi Kleen,
	Masahiro Yamada, Michal Marek, Greg Thelen

Non gcc-5 builds with CONFIG_STACK_VALIDATION=y and
SKIP_STACK_VALIDATION=1 fail.
Example output:
  /bin/sh: init/.tmp_main.o: Permission denied

commit 96f60dfa5819 ("trace: Use -mcount-record for dynamic ftrace"),
added a mismatched endif.  This causes cmd_objtool to get mistakenly
set.

Relocate endif to balance the newly added -record-mcount check.

Fixes: 96f60dfa5819 ("trace: Use -mcount-record for dynamic ftrace")
Signed-off-by: Greg Thelen <gthelen@google.com>
---
 scripts/Makefile.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 34d9e9ce97c2..e7889f486ca1 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -239,6 +239,7 @@ cmd_record_mcount =						\
 	     "$(CC_FLAGS_FTRACE)" ]; then			\
 		$(sub_cmd_record_mcount)			\
 	fi;
+endif # -record-mcount
 endif # CONFIG_FTRACE_MCOUNT_RECORD
 
 ifdef CONFIG_STACK_VALIDATION
@@ -263,7 +264,6 @@ ifneq ($(RETPOLINE_CFLAGS),)
   objtool_args += --retpoline
 endif
 endif
-endif
 
 
 ifdef CONFIG_MODVERSIONS
-- 
2.18.0.rc1.242.g61856ae69a-goog

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] trace: fix SKIP_STACK_VALIDATION=1 build
  2018-06-08 21:47 [PATCH] trace: fix SKIP_STACK_VALIDATION=1 build Greg Thelen
@ 2018-06-08 22:08 ` Andi Kleen
  2018-06-20 21:35 ` David Rientjes
  2018-06-22 17:42 ` Masahiro Yamada
  2 siblings, 0 replies; 6+ messages in thread
From: Andi Kleen @ 2018-06-08 22:08 UTC (permalink / raw)
  To: Greg Thelen
  Cc: Andi Kleen, Steven Rostedt, linux-kernel, x86, linux-kbuild,
	akpm, Andi Kleen, Masahiro Yamada, Michal Marek

On Fri, Jun 08, 2018 at 02:47:46PM -0700, Greg Thelen wrote:
> Non gcc-5 builds with CONFIG_STACK_VALIDATION=y and
> SKIP_STACK_VALIDATION=1 fail.
> Example output:
>   /bin/sh: init/.tmp_main.o: Permission denied
> 
> commit 96f60dfa5819 ("trace: Use -mcount-record for dynamic ftrace"),
> added a mismatched endif.  This causes cmd_objtool to get mistakenly
> set.
> 
> Relocate endif to balance the newly added -record-mcount check.
> 
> Fixes: 96f60dfa5819 ("trace: Use -mcount-record for dynamic ftrace")
> Signed-off-by: Greg Thelen <gthelen@google.com>

Looks good thanks.

Acked-by: Andi Kleen <ak@linux.intel.com>

-Andi

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] trace: fix SKIP_STACK_VALIDATION=1 build
  2018-06-08 21:47 [PATCH] trace: fix SKIP_STACK_VALIDATION=1 build Greg Thelen
  2018-06-08 22:08 ` Andi Kleen
@ 2018-06-20 21:35 ` David Rientjes
  2018-06-22 17:42 ` Masahiro Yamada
  2 siblings, 0 replies; 6+ messages in thread
From: David Rientjes @ 2018-06-20 21:35 UTC (permalink / raw)
  To: Greg Thelen
  Cc: Andi Kleen, Steven Rostedt, linux-kernel, x86, linux-kbuild,
	akpm, Andi Kleen, Masahiro Yamada, Michal Marek

On Fri, 8 Jun 2018, Greg Thelen wrote:

> Non gcc-5 builds with CONFIG_STACK_VALIDATION=y and
> SKIP_STACK_VALIDATION=1 fail.
> Example output:
>   /bin/sh: init/.tmp_main.o: Permission denied
> 
> commit 96f60dfa5819 ("trace: Use -mcount-record for dynamic ftrace"),
> added a mismatched endif.  This causes cmd_objtool to get mistakenly
> set.
> 
> Relocate endif to balance the newly added -record-mcount check.
> 
> Fixes: 96f60dfa5819 ("trace: Use -mcount-record for dynamic ftrace")
> Signed-off-by: Greg Thelen <gthelen@google.com>

Tested-by: David Rientjes <rientjes@google.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] trace: fix SKIP_STACK_VALIDATION=1 build
  2018-06-08 21:47 [PATCH] trace: fix SKIP_STACK_VALIDATION=1 build Greg Thelen
  2018-06-08 22:08 ` Andi Kleen
  2018-06-20 21:35 ` David Rientjes
@ 2018-06-22 17:42 ` Masahiro Yamada
  2018-06-25 14:16   ` Steven Rostedt
  2 siblings, 1 reply; 6+ messages in thread
From: Masahiro Yamada @ 2018-06-22 17:42 UTC (permalink / raw)
  To: Greg Thelen
  Cc: Andi Kleen, Steven Rostedt, Linux Kernel Mailing List, X86 ML,
	Linux Kbuild mailing list, Andrew Morton, Andi Kleen,
	Michal Marek

2018-06-09 6:47 GMT+09:00 Greg Thelen <gthelen@google.com>:
> Non gcc-5 builds with CONFIG_STACK_VALIDATION=y and
> SKIP_STACK_VALIDATION=1 fail.
> Example output:
>   /bin/sh: init/.tmp_main.o: Permission denied
>
> commit 96f60dfa5819 ("trace: Use -mcount-record for dynamic ftrace"),
> added a mismatched endif.  This causes cmd_objtool to get mistakenly
> set.
>
> Relocate endif to balance the newly added -record-mcount check.
>
> Fixes: 96f60dfa5819 ("trace: Use -mcount-record for dynamic ftrace")
> Signed-off-by: Greg Thelen <gthelen@google.com>
> ---

Applied to linux-kbuild/fixes. Thanks!



>  scripts/Makefile.build | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/Makefile.build b/scripts/Makefile.build
> index 34d9e9ce97c2..e7889f486ca1 100644
> --- a/scripts/Makefile.build
> +++ b/scripts/Makefile.build
> @@ -239,6 +239,7 @@ cmd_record_mcount =                                         \
>              "$(CC_FLAGS_FTRACE)" ]; then                       \
>                 $(sub_cmd_record_mcount)                        \
>         fi;
> +endif # -record-mcount
>  endif # CONFIG_FTRACE_MCOUNT_RECORD
>
>  ifdef CONFIG_STACK_VALIDATION
> @@ -263,7 +264,6 @@ ifneq ($(RETPOLINE_CFLAGS),)
>    objtool_args += --retpoline
>  endif
>  endif
> -endif
>
>
>  ifdef CONFIG_MODVERSIONS
> --
> 2.18.0.rc1.242.g61856ae69a-goog
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] trace: fix SKIP_STACK_VALIDATION=1 build
  2018-06-22 17:42 ` Masahiro Yamada
@ 2018-06-25 14:16   ` Steven Rostedt
  2018-06-25 14:20     ` Masahiro Yamada
  0 siblings, 1 reply; 6+ messages in thread
From: Steven Rostedt @ 2018-06-25 14:16 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Greg Thelen, Andi Kleen, Linux Kernel Mailing List, X86 ML,
	Linux Kbuild mailing list, Andrew Morton, Andi Kleen,
	Michal Marek

On Sat, 23 Jun 2018 02:42:26 +0900
Masahiro Yamada <yamada.masahiro@socionext.com> wrote:

> 2018-06-09 6:47 GMT+09:00 Greg Thelen <gthelen@google.com>:
> > Non gcc-5 builds with CONFIG_STACK_VALIDATION=y and
> > SKIP_STACK_VALIDATION=1 fail.
> > Example output:
> >   /bin/sh: init/.tmp_main.o: Permission denied
> >
> > commit 96f60dfa5819 ("trace: Use -mcount-record for dynamic ftrace"),
> > added a mismatched endif.  This causes cmd_objtool to get mistakenly
> > set.
> >
> > Relocate endif to balance the newly added -record-mcount check.
> >
> > Fixes: 96f60dfa5819 ("trace: Use -mcount-record for dynamic ftrace")
> > Signed-off-by: Greg Thelen <gthelen@google.com>
> > ---  
> 
> Applied to linux-kbuild/fixes. Thanks!
> 
> 

I already pushed this to Linus. As I was the one to mess it up in the
first place ;-) (I think I applied it with some fuzz)

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ed7d40bc67b8353c677b38c6cdddcdc310c0f452

-- Steve

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] trace: fix SKIP_STACK_VALIDATION=1 build
  2018-06-25 14:16   ` Steven Rostedt
@ 2018-06-25 14:20     ` Masahiro Yamada
  0 siblings, 0 replies; 6+ messages in thread
From: Masahiro Yamada @ 2018-06-25 14:20 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Greg Thelen, Andi Kleen, Linux Kernel Mailing List, X86 ML,
	Linux Kbuild mailing list, Andrew Morton, Andi Kleen,
	Michal Marek

2018-06-25 23:16 GMT+09:00 Steven Rostedt <rostedt@goodmis.org>:
> On Sat, 23 Jun 2018 02:42:26 +0900
> Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
>
>> 2018-06-09 6:47 GMT+09:00 Greg Thelen <gthelen@google.com>:
>> > Non gcc-5 builds with CONFIG_STACK_VALIDATION=y and
>> > SKIP_STACK_VALIDATION=1 fail.
>> > Example output:
>> >   /bin/sh: init/.tmp_main.o: Permission denied
>> >
>> > commit 96f60dfa5819 ("trace: Use -mcount-record for dynamic ftrace"),
>> > added a mismatched endif.  This causes cmd_objtool to get mistakenly
>> > set.
>> >
>> > Relocate endif to balance the newly added -record-mcount check.
>> >
>> > Fixes: 96f60dfa5819 ("trace: Use -mcount-record for dynamic ftrace")
>> > Signed-off-by: Greg Thelen <gthelen@google.com>
>> > ---
>>
>> Applied to linux-kbuild/fixes. Thanks!
>>
>>
>
> I already pushed this to Linus. As I was the one to mess it up in the
> first place ;-) (I think I applied it with some fuzz)
>
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ed7d40bc67b8353c677b38c6cdddcdc310c0f452
>

OK.
I will drop this, then.

Thanks for the info.



> -- Steve
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-06-25 14:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-08 21:47 [PATCH] trace: fix SKIP_STACK_VALIDATION=1 build Greg Thelen
2018-06-08 22:08 ` Andi Kleen
2018-06-20 21:35 ` David Rientjes
2018-06-22 17:42 ` Masahiro Yamada
2018-06-25 14:16   ` Steven Rostedt
2018-06-25 14:20     ` Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).