All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/3] objtool: Add mcount sub-command
@ 2022-03-18 10:51 ` Sathvika Vasireddy
  0 siblings, 0 replies; 60+ messages in thread
From: Sathvika Vasireddy @ 2022-03-18 10:51 UTC (permalink / raw)
  To: linuxppc-dev
  Cc: jpoimboe, peterz, linux-kernel, aik, mpe, rostedt, naveen.n.rao, sv

This patchset adds support to implement 'objtool mcount' command.

Right now, objtool is built if CONFIG_STACK_VALIDATION is enabled.
And, '__mcount_loc' section is generated by objtool when --mcount 
option is passed to check sub-command. 

For architectures to be able to generate '__mcount_loc' section
without having to do stack validation, introduce 'mcount' as
a sub-command to objtool. This way, objtool is built for mcount 
if CONFIG_FTRACE_MCOUNT_USE_OBJTOOL is enabled. Additionally, 
architectures can select HAVE_NOP_MCOUNT to be able to nop out
mcount call sites.  

TODO: Enable "objtool mcount" for clang LTO builds.

Sathvika Vasireddy (3):
  objtool: Move common code to utils.c
  objtool: Enable and implement 'mcount' subcommand
  objtool/mcount: Add powerpc specific functions

 Makefile                                      |   6 +
 arch/powerpc/Kconfig                          |   1 +
 arch/x86/Kconfig                              |   3 +-
 scripts/Makefile.build                        |  12 +
 tools/objtool/Build                           |   3 +
 tools/objtool/Makefile                        |   8 +-
 tools/objtool/arch/powerpc/Build              |   1 +
 tools/objtool/arch/powerpc/decode.c           |  51 +++++
 .../arch/powerpc/include/arch/cfi_regs.h      |  37 +++
 tools/objtool/arch/powerpc/include/arch/elf.h |   8 +
 tools/objtool/builtin-mcount.c                |  74 ++++++
 tools/objtool/check.c                         | 178 +--------------
 tools/objtool/include/objtool/builtin.h       |   4 +-
 tools/objtool/include/objtool/check.h         |   2 -
 tools/objtool/include/objtool/objtool.h       |   1 +
 tools/objtool/include/objtool/utils.h         |  28 +++
 tools/objtool/mcount.c                        | 138 ++++++++++++
 tools/objtool/objtool.c                       |   1 +
 tools/objtool/orc_gen.c                       |   1 +
 tools/objtool/utils.c                         | 210 ++++++++++++++++++
 tools/objtool/weak.c                          |   5 +
 21 files changed, 590 insertions(+), 182 deletions(-)
 create mode 100644 tools/objtool/arch/powerpc/Build
 create mode 100644 tools/objtool/arch/powerpc/decode.c
 create mode 100644 tools/objtool/arch/powerpc/include/arch/cfi_regs.h
 create mode 100644 tools/objtool/arch/powerpc/include/arch/elf.h
 create mode 100644 tools/objtool/builtin-mcount.c
 create mode 100644 tools/objtool/include/objtool/utils.h
 create mode 100644 tools/objtool/mcount.c
 create mode 100644 tools/objtool/utils.c

-- 
2.31.1


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

end of thread, other threads:[~2022-05-23  5:41 UTC | newest]

Thread overview: 60+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-18 10:51 [RFC PATCH 0/3] objtool: Add mcount sub-command Sathvika Vasireddy
2022-03-18 10:51 ` Sathvika Vasireddy
2022-03-18 10:51 ` [RFC PATCH 1/3] objtool: Move common code to utils.c Sathvika Vasireddy
2022-03-18 10:51   ` Sathvika Vasireddy
2022-03-23 18:02   ` Miroslav Benes
2022-03-23 18:02     ` Miroslav Benes
2022-03-18 10:51 ` [RFC PATCH 2/3] objtool: Enable and implement 'mcount' subcommand Sathvika Vasireddy
2022-03-18 10:51   ` Sathvika Vasireddy
2022-03-21  7:06   ` Christophe Leroy
2022-03-21  8:19     ` Naveen N. Rao
2022-03-21  8:19       ` Naveen N. Rao
2022-03-21  8:26       ` Christophe Leroy
2022-03-21  8:26         ` Christophe Leroy
2022-03-21  9:48         ` Naveen N. Rao
2022-03-21  9:48           ` Naveen N. Rao
2022-03-18 10:51 ` [RFC PATCH 3/3] objtool/mcount: Add powerpc specific functions Sathvika Vasireddy
2022-03-18 10:51   ` Sathvika Vasireddy
2022-03-18 12:26   ` Peter Zijlstra
2022-03-18 12:26     ` Peter Zijlstra
2022-03-18 13:59     ` Christophe Leroy
2022-03-18 13:59       ` Christophe Leroy
2022-03-21  2:27       ` Michael Ellerman
2022-03-21  6:47         ` Christophe Leroy
2022-03-21  7:46         ` Christophe Leroy
2022-03-21  7:56         ` Christophe Leroy
2022-03-21  8:30           ` Christophe Leroy
2022-03-21  8:59             ` Christophe Leroy
2022-03-26  7:58           ` Christophe Leroy
2022-03-26  7:58             ` Christophe Leroy
2022-03-21  6:25     ` Naveen N. Rao
2022-03-21  6:25       ` Naveen N. Rao
2022-03-27  9:09     ` Christophe Leroy
2022-03-27  9:09       ` Christophe Leroy
2022-03-28 19:59       ` Josh Poimboeuf
2022-03-28 19:59         ` Josh Poimboeuf
2022-03-28 20:14         ` Peter Zijlstra
2022-03-28 20:14           ` Peter Zijlstra
2022-03-28 20:15           ` Peter Zijlstra
2022-03-28 20:15             ` Peter Zijlstra
2022-03-28 20:21           ` Josh Poimboeuf
2022-03-28 20:21             ` Josh Poimboeuf
2022-03-29 12:01         ` Michael Ellerman
2022-03-29 12:01           ` Michael Ellerman
2022-03-29 17:32           ` Christophe Leroy
2022-03-30  4:26             ` Josh Poimboeuf
2022-03-30  4:26               ` Josh Poimboeuf
2022-03-30 18:40             ` Naveen N. Rao
2022-03-30 18:40               ` Naveen N. Rao
2022-05-12 14:52         ` Christophe Leroy
2022-05-12 14:52           ` Christophe Leroy
2022-05-12 15:12           ` Josh Poimboeuf
2022-05-12 15:12             ` Josh Poimboeuf
2022-05-21  9:38             ` Christophe Leroy
2022-05-21  9:38               ` Christophe Leroy
2022-05-21 10:57               ` Peter Zijlstra
2022-05-21 10:57                 ` Peter Zijlstra
2022-05-23  5:39                 ` Naveen N. Rao
2022-05-23  5:39                   ` Naveen N. Rao
2022-03-19  1:35 ` [RFC PATCH 0/3] objtool: Add mcount sub-command Josh Poimboeuf
2022-03-19  1:35   ` Josh Poimboeuf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.