On Fri, Apr 11, 2025 at 4:05 AM Björn Töpel <[email protected]> wrote: > > (Trimming the Cc:-list a bit) > > Hi Andy! > > Andy Chiu <[email protected]> writes: > > > From: Andy Chiu <[email protected]> > ... > > (Oh, if you send another revision, please add a cover, so it's easier to > comment around the full series.)
I am so sorry about this! I wrote a cover letter but apparently I didn't send it. I am attaching the original cover letter below. Please let me know if there is any better way to address this trouble. > > Thanks a lot for doing the lion part of this series, Andy! With this in > place, *finally* stop machine way of text patching is past us, and we > can move RISC-V out from the 20th century. ;-) > > I applied your series, and Steven's series [1] to [2], and ran that on > QEMU (riscv64, ~RVA23), and on Milk-V Jupiter (Spacemit K1) with: > * CONFIG_FTRACE_STARTUP_TEST > * ftrace kselftest > > No visible regressions, and now the ftrace kselftest can actually > complete! For the series: > > Tested-by: Björn Töpel <[email protected]> > > [1] https://lore.kernel.org/all/[email protected]/ > [2] commit 3b07108ada81 ("Merge tag 'linux_kselftest-fixes-6.15-rc2' of > git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest") > > > Björn This series makes atomic code patching in ftrace possible and eliminates the need of the stop_machine dance. The major difference of this version is that we merge the CALL_OPS support from Puranjay [1] and make direct calls available for practical uses such as BPF. Thanks for the time reviewing the series and suggestions, we hope this version gets a step closer to happening in the upstream. Please reference the link to v3 below for more introductory view of the implementation Added patch: 2, 4, 10, 11, 12 Modified patch: 5, 6 Unchanged patch: 1, 3, 7, 8, 9 (1, 8 has commit msg modified) Special thanks to Björn for his efforts on testing and guiding the series! [1]: https://lore.kernel.org/lkml/[email protected]/ Changes in v4: - Rebase on top of v6.15-rc1 - Add a fix tag and R-b from Björn (1) - Remove unused code enclosed by !WITH_ARG and unused macros (2, 5) - Export ftrace_sync_ipi for its use in riscv (3, 4) - Fix a bug with kprobe after probing at the start of symbol is allowed, by correcting ftrace_call_adjust (5, 11) - Synchronize update of ftrace destination and the data passed to it (5) - Include Puranjay's patch for CALL_OPS (10) - Support direct calls based on CALL_OPS (11) - Add a documentation that breifly explain CMODX for dynamic ftrace (12) - Link to v3: https://lore.kernel.org/r/[email protected] Changes in v3: - Add a fix tag for patch 1 - Add a data fence before sending out remote fence.i (6) - Link to v2: https://lore.kernel.org/all/[email protected]/ Changes in v2: - Drop patch 1 as it is merged through fixes. - Drop patch 2, which converts kernel_text_address into notrace. As users can prevent tracing it by configuring the tracefs. - Use a more generic way in kconfig to align functions. - Link to v1: https://lore.kernel.org/r/[email protected] Andy Chiu (11): riscv: ftrace: support fastcc in Clang for WITH_ARGS riscv: ftrace factor out code defined by !WITH_ARG riscv: ftrace: align patchable functions to 4 Byte boundary kernel: ftrace: export ftrace_sync_ipi riscv: ftrace: prepare ftrace for atomic code patching riscv: ftrace: do not use stop_machine to update code riscv: vector: Support calling schedule() for preemptible Vector riscv: add a data fence for CMODX in the kernel mode riscv: ftrace: support PREEMPT riscv: ftrace: support direct call using call_ops riscv: Documentation: add a description about dynamic ftrace Puranjay Mohan (1): riscv: Implement HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS Documentation/arch/riscv/cmodx.rst | 46 +++++- arch/riscv/Kconfig | 8 +- arch/riscv/Makefile | 4 +- arch/riscv/include/asm/ftrace.h | 62 ++++---- arch/riscv/include/asm/processor.h | 5 + arch/riscv/include/asm/vector.h | 22 ++- arch/riscv/kernel/asm-offsets.c | 13 ++ arch/riscv/kernel/ftrace.c | 241 +++++++++++++++-------------- arch/riscv/kernel/mcount-dyn.S | 117 ++++++++------ arch/riscv/mm/cacheflush.c | 15 +- include/linux/ftrace.h | 1 + kernel/trace/ftrace.c | 2 +- 12 files changed, 327 insertions(+), 209 deletions(-) -- 2.39.3 (Apple Git-145)
