Skip to content

RFC arm64: Prepare instruction decoder for objtool

Julien Thierry linux-arm-kernel lkml 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 RFC Latest8 patches 0 repliesNew
  2. v1 RFC5 patches 6 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8arm64: Move patching utilities out of instruction encoding/decodingarch/arm64/include/asm/insn.h arch/arm64/include/asm/patching.h arch/arm64/kernel/Makefile +5 more+168 -1520 replies
2/8arm64: Move aarch32 condition check functionsarch/arm64/include/asm/insn.h arch/arm64/include/asm/probes.h arch/arm64/include/asm/traps.h +3 more+103 -1020 replies
3/8arm64: insn: Reduce header dependencies of instruction decoderarch/arm64/include/asm/alternative-macros.h arch/arm64/include/asm/insn.h+2 -40 replies
4/8arm64: Move instruction encoder/decoder under lib/arch/arm64/kernel/Makefile arch/arm64/lib/Makefile arch/arm64/lib/insn.c+4 -40 replies
5/8arm64: insn: Add SVE instruction classarch/arm64/include/asm/insn.h arch/arm64/lib/insn.c+2 -10 replies
6/8arm64: insn: Add barrier encodingsarch/arm64/include/asm/insn.h+22 -00 replies
7/8arm64: insn: Add some opcodes to instruction decoderarch/arm64/include/asm/insn.h+9 -00 replies
8/8arm64: insn: Add load/store decoding helpersarch/arm64/include/asm/insn.h+28 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [RFC PATCH v2 0/8] arm64: Prepare instruction decoder for objtool

To support arm64, objtool will need to be able to decode aarch64 instructions. This patch series adds some instruction definitions needed by objtool and moves out encoding/decoding functionalities that do not rely on kernel code in order.

Changes since v1[1]:
- Split the isolation of instruction encoder/decoder capabilities in several steps as suggested by Mark R.
- Exclude dsb encoding where CRm != 0b0x00
- Support dsb FEAT_XS encoding
- Support previously missing barriers

[1] https://lkml.org/lkml/2021/1/20/791

Thanks,

Julien

-->

Julien Thierry (8):
arm64: Move patching utilities out of instruction encoding/decoding
arm64: Move aarch32 condition check functions
arm64: insn: Reduce header dependencies of instruction decoder
arm64: Move instruction encoder/decoder under lib/
arm64: insn: Add SVE instruction class
arm64: insn: Add barrier encodings
arm64: insn: Add some opcodes to instruction decoder
arm64: insn: Add load/store decoding helpers

 arch/arm64/include/asm/alternative-macros.h |   3 -
 arch/arm64/include/asm/insn.h               |  70 +++++-
 arch/arm64/include/asm/patching.h           |  13 +
 arch/arm64/include/asm/probes.h             |   2 +-
 arch/arm64/include/asm/traps.h              |   3 +
 arch/arm64/kernel/Makefile                  |   4 +-
 arch/arm64/kernel/ftrace.c                  |   1 +
 arch/arm64/kernel/jump_label.c              |   1 +
 arch/arm64/kernel/patching.c                | 148 ++++++++++++
 arch/arm64/kernel/probes/simulate-insn.c    |   1 +
 arch/arm64/kernel/traps.c                   | 100 +++++++-
 arch/arm64/lib/Makefile                     |   6 +-
 arch/arm64/{kernel => lib}/insn.c           | 249 +-------------------
 13 files changed, 338 insertions(+), 263 deletions(-)
 create mode 100644 arch/arm64/include/asm/patching.h
 create mode 100644 arch/arm64/kernel/patching.c
 rename arch/arm64/{kernel => lib}/insn.c (86%)

--
2.25.4