linux/arch/riscv
Palmer Dabbelt ec6311919e
Merge patch series "riscv: Optimize function trace"
guoren@kernel.org <guoren@kernel.org> says:

From: Guo Ren <guoren@linux.alibaba.com>

The previous ftrace detour implementation fc76b8b8011 ("riscv: Using
PATCHABLE_FUNCTION_ENTRY instead of MCOUNT") contain three problems.

 - The most horrible bug is preemption panic which found by Andy [1].
   Let's disable preemption for ftrace first, and Andy could continue
   the ftrace preemption work.
 - The "-fpatchable-function-entry= CFLAG" wasted code size
   !RISCV_ISA_C.
 - The ftrace detour implementation wasted code size.
 - When livepatching, the trampoline (ftrace_regs_caller) would not
   return to <func_prolog+12> but would rather jump to the new function.
   So, "REG_L ra, -SZREG(sp)" would not run and the original return
   address would not be restored. The kernel is likely to hang or crash
   as a result. (Found by Evgenii Shatokhin [4])

[Palmer: The first three patches in this series are pretty concrete
fixes, so I'm pulling them ahead of the rest of the series.]

* b4-shazam-merge:
  riscv: ftrace: Reduce the detour code size to half
  riscv: ftrace: Remove wasted nops for !RISCV_ISA_C
  riscv: ftrace: Fixup panic by disabling preemption

Link: https://lore.kernel.org/r/20230112090603.1295340-1-guoren@kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2023-02-15 10:59:54 -08:00
..
boot RISC-V: kbuild: convert all use of SOC_FOO to ARCH_FOO 2022-12-27 18:01:40 +00:00
configs RISC-V Patches for the 6.2 Merge Window, Part 1 2022-12-14 15:23:49 -08:00
errata riscv: Fix early alternative patching 2023-02-14 16:10:35 -08:00
include Merge patch series "riscv: Optimize function trace" 2023-02-15 10:59:54 -08:00
kernel Merge patch series "riscv: Optimize function trace" 2023-02-15 10:59:54 -08:00
kvm riscv: KVM: Switch has_svinval() to riscv_has_extension_unlikely() 2023-01-31 23:29:44 -08:00
lib riscv: Fix Zbb alternative IDs 2023-02-14 16:10:36 -08:00
mm RISC-V Patches for the 6.2 Merge Window, Part 1 2022-12-14 15:23:49 -08:00
net riscv, bpf: Emit fixed-length instructions for BPF_PSEUDO_FUNC 2022-12-06 20:59:27 +01:00
purgatory RISC-V: add infrastructure to allow different str* implementations 2023-01-31 11:43:23 -08:00
Kbuild riscv: move errata/ and kvm/ builds to arch/riscv/Kbuild 2022-06-01 22:26:32 -07:00
Kconfig Merge patch series "riscv: Optimize function trace" 2023-02-15 10:59:54 -08:00
Kconfig.debug
Kconfig.erratas drivers/perf: riscv_pmu_sbi: add support for PMU variant on T-Head C9xx cores 2022-10-27 14:35:20 -07:00
Kconfig.socs RISC-V: Kconfig: Remove trailing whitespace 2023-01-24 18:09:12 -08:00
Makefile Merge patch series "riscv: Optimize function trace" 2023-02-15 10:59:54 -08:00