public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/8] Add RISC-V asm/insn.h header
@ 2022-02-24 15:24 Emil Renner Berthing
  2022-02-24 15:24 ` [PATCH v3 1/8] riscv: Avoid unaligned access when relocating modules Emil Renner Berthing
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: Emil Renner Berthing @ 2022-02-24 15:24 UTC (permalink / raw)
  To: linux-riscv
  Cc: Emil Renner Berthing, Steven Rostedt, Ingo Molnar, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Peter Zijlstra, Josh Poimboeuf,
	Jason Baron, Ard Biesheuvel, Jisheng Zhang, Alexandre Ghiti,
	linux-kernel

This series adds a RISC-V asm/insn.h header to consolidate instruction
generation and manipulation similar to arm64's asm/insn.h.

The first three patches are preparatory patches fixing unaligned access
in module relocations and moving unneded definitions out of asm/module.h
and asm/ftrace.h.
Patch 4 adds the header and the remaining patches converts module
relocation, plt entry, jump label and dynamic ftrace code to use it.

The only obvious code left to convert is the BPF JIT(s).

This series depends on the module relocation range check fix here:
https://lore.kernel.org/linux-riscv/20220223191257.143694-1-kernel@esmil.dk/

Changes since v2:
- Split the range check fix out and send it separately.
- Convert "if (IS_DEFINED(CONFIG_32BIT))" to #ifdef to avoid compiler
  warning on rv32. Thanks kernel test robot!
- Add sp register, load/store instructions and RISCV_INSN_REG_L,
  RISCV_INSN_REG_S and RISC_INSN_SZREG macros to work on both rv32 and
  rv64 to the asm/insn.h header.
- Add patch moving unneded definitions out of out asm/ftrace.h and a
  patch converting kernel/ftrace.c to use the header.

Changes since v1:
- Send the right patches.

Emil Renner Berthing (8):
  riscv: Avoid unaligned access when relocating modules
  riscv: Remove unneeded definitions from asm/module.h
  riscv: Remove unneeded definitions from asm/ftrace.h
  riscv: Add asm/insn.h header
  riscv: Use asm/insn.h for module relocations
  riscv: Use asm/insn.h to generate plt entries
  riscv: Use asm/insn.h for jump labels
  riscv: Use asm/insn.h for dynamic ftrace

 arch/riscv/include/asm/ftrace.h     |  35 +----
 arch/riscv/include/asm/insn.h       | 151 ++++++++++++++++++
 arch/riscv/include/asm/module.h     |  87 ----------
 arch/riscv/kernel/ftrace.c          |  56 ++++---
 arch/riscv/kernel/jump_label.c      |  12 +-
 arch/riscv/kernel/module-sections.c |  71 +++++++++
 arch/riscv/kernel/module.c          | 236 +++++++++++++---------------
 7 files changed, 364 insertions(+), 284 deletions(-)
 create mode 100644 arch/riscv/include/asm/insn.h

-- 
2.35.1


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

end of thread, other threads:[~2022-02-28 12:46 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-24 15:24 [PATCH v3 0/8] Add RISC-V asm/insn.h header Emil Renner Berthing
2022-02-24 15:24 ` [PATCH v3 1/8] riscv: Avoid unaligned access when relocating modules Emil Renner Berthing
2022-02-26  4:48   ` Samuel Bronson
2022-02-28 12:46     ` Emil Renner Berthing
2022-02-24 15:24 ` [PATCH v3 2/8] riscv: Remove unneeded definitions from asm/module.h Emil Renner Berthing
2022-02-24 15:24 ` [PATCH v3 3/8] riscv: Remove unneeded definitions from asm/ftrace.h Emil Renner Berthing
2022-02-24 15:24 ` [PATCH v3 4/8] riscv: Add asm/insn.h header Emil Renner Berthing
2022-02-24 15:24 ` [PATCH v3 5/8] riscv: Use asm/insn.h for module relocations Emil Renner Berthing
2022-02-24 15:24 ` [PATCH v3 6/8] riscv: Use asm/insn.h to generate plt entries Emil Renner Berthing
2022-02-24 15:24 ` [PATCH v3 7/8] riscv: Use asm/insn.h for jump labels Emil Renner Berthing
2022-02-24 15:24 ` [PATCH v3 8/8] riscv: Use asm/insn.h for dynamic ftrace Emil Renner Berthing

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox