[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201014165004.GA3593121@gmail.com>
Date: Wed, 14 Oct 2020 18:50:04 +0200
From: Ingo Molnar <mingo@...nel.org>
To: Sami Tolvanen <samitolvanen@...gle.com>
Cc: Masahiro Yamada <masahiroy@...nel.org>,
Steven Rostedt <rostedt@...dmis.org>,
Will Deacon <will@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Paul E. McKenney" <paulmck@...nel.org>,
Kees Cook <keescook@...omium.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
clang-built-linux@...glegroups.com,
kernel-hardening@...ts.openwall.com, linux-arch@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kbuild@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-pci@...r.kernel.org,
x86@...nel.org, Josh Poimboeuf <jpoimboe@...hat.com>
Subject: Re: [PATCH v6 02/25] objtool: Add a pass for generating __mcount_loc
* Sami Tolvanen <samitolvanen@...gle.com> wrote:
> From: Peter Zijlstra <peterz@...radead.org>
>
> Add the --mcount option for generating __mcount_loc sections
> needed for dynamic ftrace. Using this pass requires the kernel to
> be compiled with -mfentry and CC_USING_NOP_MCOUNT to be defined
> in Makefile.
>
> Link: https://lore.kernel.org/lkml/20200625200235.GQ4781@hirez.programming.kicks-ass.net/
> Signed-off-by: Peter Zijlstra <peterz@...radead.org>
> [Sami: rebased, dropped config changes, fixed to actually use --mcount,
> and wrote a commit message.]
> Signed-off-by: Sami Tolvanen <samitolvanen@...gle.com>
> Reviewed-by: Kees Cook <keescook@...omium.org>
> ---
> tools/objtool/builtin-check.c | 3 +-
> tools/objtool/builtin.h | 2 +-
> tools/objtool/check.c | 82 +++++++++++++++++++++++++++++++++++
> tools/objtool/check.h | 1 +
> tools/objtool/objtool.c | 1 +
> tools/objtool/objtool.h | 1 +
> 6 files changed, 88 insertions(+), 2 deletions(-)
>
> diff --git a/tools/objtool/builtin-check.c b/tools/objtool/builtin-check.c
> index c6d199bfd0ae..e92e76f69176 100644
> --- a/tools/objtool/builtin-check.c
> +++ b/tools/objtool/builtin-check.c
> @@ -18,7 +18,7 @@
> #include "builtin.h"
> #include "objtool.h"
>
> -bool no_fp, no_unreachable, retpoline, module, backtrace, uaccess, stats, validate_dup, vmlinux;
> +bool no_fp, no_unreachable, retpoline, module, backtrace, uaccess, stats, validate_dup, vmlinux, mcount;
>
> static const char * const check_usage[] = {
> "objtool check [<options>] file.o",
> @@ -35,6 +35,7 @@ const struct option check_options[] = {
> OPT_BOOLEAN('s', "stats", &stats, "print statistics"),
> OPT_BOOLEAN('d', "duplicate", &validate_dup, "duplicate validation for vmlinux.o"),
> OPT_BOOLEAN('l', "vmlinux", &vmlinux, "vmlinux.o validation"),
> + OPT_BOOLEAN('M', "mcount", &mcount, "generate __mcount_loc"),
> OPT_END(),
> };
Meh, adding --mcount as an option to 'objtool check' was a valid hack for a
prototype patchset, but please turn this into a proper subcommand, just
like 'objtool orc' is.
'objtool check' should ... keep checking. :-)
Thanks,
Ingo
Powered by blists - more mailing lists