linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v3 00/13] objtool: add base support for arm64
@ 2022-04-07 12:01 Chen Zhongjin
  2022-04-07 12:01 ` [RFC PATCH v3 01/13] tools: Add some generic functions and headers Chen Zhongjin
                   ` (12 more replies)
  0 siblings, 13 replies; 16+ messages in thread
From: Chen Zhongjin @ 2022-04-07 12:01 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel
  Cc: jthierry, catalin.marinas, will, mark.rutland, ardb, masahiroy,
	jpoimboe, peterz, ycote

Hi,

This series enables objtool to start doing stack validation on arm64
kernel builds.

The work for objtool has been stopped for a while. Julien and
Raphael worked for this [1] but it seems now nobody is carrying it
on.

To re-bring it to people's vision, this v3 update just makes some
simply changes including rebasing to mainline, code cleanning and
one bug fix.

Previous patch had finished the decoder part of objtool. It passed
my building test with allyesconfig and only few of objfile report
error. Julien had some unorganized commits in his repo [2], mainly
about changes to arm64 code to eliminate some of these errors.

While fixing these problems in next version, I'm also planning to
implement the orc unwinder for arm64, then we can completely test
everything on arm64.

[1] https://lkml.org/lkml/2021/3/3/1135
[2] https://github.com/julien-thierry/linux.git
---
Changs v2 -> v3:
- [04] rebase Julien's version to mainstream and solve conflicts.
- [05, 06, 08] Merge dumplicate "*type = INSN_OTHER".
- [08, 09, 10] When meeting unrecognized instructions such as  datas
	in .text code or 0x0 padding insns, last version used
	"loc->ignorable" to mark and remove them from objtool insn list.

	However there are two problems to do so:
	1. when meeting insns can't be decoded or excluded, objtool will
	just stop.
	2. deleting every insn can cause problems in fellow procedure.

	So I changed "record_invalid_insn" that we can delete one insn or
	just set it ignored. Now check will throw an error and going on when
	meeting undecodable instructions. Also, to prevent the confusion
	between "loc->ignorable" and "insn->ignore" I changed "ignore" to
	"delete".

Changs v1 -> v2:
- Drop gcc plugin in favor of -fno-jump-tables
- miscelaneous fixes and cleanups

--->
Julien Thierry (12):
  tools: Add some generic functions and headers
  tools: arm64: Make aarch64 instruction decoder available to tools
  tools: bug: Remove duplicate definition
  objtool: arm64: Add base definition for arm64 backend
  objtool: arm64: Decode add/sub instructions
  objtool: arm64: Decode jump and call related instructions
  objtool: arm64: Decode other system instructions
  objtool: arm64: Decode load/store instructions
  objtool: arm64: Decode LDR instructions
  objtool: arm64: Accept non-instruction data in code sections
  objtool: arm64: Handle supported relocations in alternatives
  objtool: arm64: Ignore replacement section for alternative callback

Raphael Gault (1):
  objtool: arm64: Enable stack validation for arm64

 arch/arm64/Kconfig                            |    1 +
 arch/arm64/Makefile                           |    4 +
 tools/arch/arm64/include/asm/insn.h           |  565 +++++++
 tools/arch/arm64/lib/insn.c                   | 1464 +++++++++++++++++
 tools/include/asm-generic/bitops/__ffs.h      |   11 +
 tools/include/linux/bug.h                     |    6 +-
 tools/include/linux/kernel.h                  |   21 +
 tools/include/linux/printk.h                  |   40 +
 tools/objtool/Makefile                        |    5 +
 tools/objtool/arch/arm64/Build                |    8 +
 tools/objtool/arch/arm64/decode.c             |  500 ++++++
 .../arch/arm64/include/arch/cfi_regs.h        |   14 +
 tools/objtool/arch/arm64/include/arch/elf.h   |    8 +
 .../arch/arm64/include/arch/endianness.h      |    9 +
 .../objtool/arch/arm64/include/arch/special.h |   22 +
 tools/objtool/arch/arm64/special.c            |   36 +
 tools/objtool/arch/x86/decode.c               |    5 +
 tools/objtool/check.c                         |    6 +
 tools/objtool/include/objtool/arch.h          |    3 +
 tools/objtool/sync-check.sh                   |    5 +
 20 files changed, 2728 insertions(+), 5 deletions(-)
 create mode 100644 tools/arch/arm64/include/asm/insn.h
 create mode 100644 tools/arch/arm64/lib/insn.c
 create mode 100644 tools/include/linux/printk.h
 create mode 100644 tools/objtool/arch/arm64/Build
 create mode 100644 tools/objtool/arch/arm64/decode.c
 create mode 100644 tools/objtool/arch/arm64/include/arch/cfi_regs.h
 create mode 100644 tools/objtool/arch/arm64/include/arch/elf.h
 create mode 100644 tools/objtool/arch/arm64/include/arch/endianness.h
 create mode 100644 tools/objtool/arch/arm64/include/arch/special.h
 create mode 100644 tools/objtool/arch/arm64/special.c

-- 
2.17.1


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

end of thread, other threads:[~2022-04-08  9:26 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-07 12:01 [RFC PATCH v3 00/13] objtool: add base support for arm64 Chen Zhongjin
2022-04-07 12:01 ` [RFC PATCH v3 01/13] tools: Add some generic functions and headers Chen Zhongjin
2022-04-07 12:01 ` [RFC PATCH v3 02/13] tools: arm64: Make aarch64 instruction decoder available to tools Chen Zhongjin
2022-04-07 12:01 ` [RFC PATCH v3 03/13] tools: bug: Remove duplicate definition Chen Zhongjin
2022-04-07 12:01 ` [RFC PATCH v3 04/13] objtool: arm64: Add base definition for arm64 backend Chen Zhongjin
2022-04-07 12:01 ` [RFC PATCH v3 05/13] objtool: arm64: Decode add/sub instructions Chen Zhongjin
2022-04-07 12:01 ` [RFC PATCH v3 06/13] objtool: arm64: Decode jump and call related instructions Chen Zhongjin
2022-04-07 12:01 ` [RFC PATCH v3 07/13] objtool: arm64: Decode other system instructions Chen Zhongjin
2022-04-07 12:01 ` [RFC PATCH v3 08/13] objtool: arm64: Decode load/store instructions Chen Zhongjin
2022-04-07 12:01 ` [RFC PATCH v3 09/13] objtool: arm64: Decode LDR instructions Chen Zhongjin
2022-04-07 12:01 ` [RFC PATCH v3 10/13] objtool: arm64: Accept non-instruction data in code sections Chen Zhongjin
2022-04-07 12:01 ` [RFC PATCH v3 11/13] objtool: arm64: Handle supported relocations in alternatives Chen Zhongjin
2022-04-07 12:01 ` [RFC PATCH v3 12/13] objtool: arm64: Ignore replacement section for alternative callback Chen Zhongjin
2022-04-07 12:01 ` [RFC PATCH v3 13/13] objtool: arm64: Enable stack validation for arm64 Chen Zhongjin
2022-04-07 12:19   ` Peter Zijlstra
2022-04-08  9:25     ` Chen Zhongjin

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).