[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFTtA3M86-iL8zARtoGwcX5yAi0LOC0tzcocVwaKLdnyGSAxJw@mail.gmail.com>
Date: Wed, 7 May 2025 21:58:00 +0800
From: Andy Chiu <andybnac@...il.com>
To: Björn Töpel <bjorn@...nel.org>
Cc: linux-riscv@...ts.infradead.org, alexghiti@...osinc.com,
palmer@...belt.com, Steven Rostedt <rostedt@...dmis.org>, Andy Chiu <andy.chiu@...ive.com>,
Evgenii Shatokhin <e.shatokhin@...ro.com>, Nathan Chancellor <nathan@...nel.org>,
Björn Töpel <bjorn@...osinc.com>,
Palmer Dabbelt <palmer@...osinc.com>, Puranjay Mohan <puranjay@...nel.org>, linux-kernel@...r.kernel.org,
linux-trace-kernel@...r.kernel.org, Alexandre Ghiti <alex@...ti.fr>,
paul.walmsley@...ive.com, samuel.holland@...ive.com
Subject: Re: [PATCH v4 01/12] riscv: ftrace: support fastcc in Clang for WITH_ARGS
On Fri, Apr 11, 2025 at 4:05 AM Björn Töpel <bjorn@...nel.org> wrote:
>
> (Trimming the Cc:-list a bit)
>
> Hi Andy!
>
> Andy Chiu <andybnac@...il.com> writes:
>
> > From: Andy Chiu <andy.chiu@...ive.com>
> ...
>
> (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 <bjorn@...osinc.com>
>
> [1] https://lore.kernel.org/all/20250409151549.788068911@goodmis.org/
> [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/20240306165904.108141-1-puranjay12@gmail.com/
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/20241127172908.17149-1-andybnac@gmail.com
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/20240628-dev-andyc-dyn-ftrace-v4-v2-0-1e5f4cb1f049@sifive.com/
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/20240613-dev-andyc-dyn-ftrace-v4-v1-0-1a538e12c01e@sifive.com
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)
Powered by blists - more mailing lists