Re: [PATCH v3 0/7] riscv: ftrace: atmoic patching and preempt improvements

Evgenii Shatokhin
2024-12-03T15:09:38Z

On 03.12.2024 15:18, Björn Töpel wrote:
> Andy!
>
> "atomic" spelling in the Subject line.
>
> Andy Chiu <andybnac@gmail.com> writes:
>
>> 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/
>
> Hmm, the fixes tag was not included.
>
> Also, there was a lot of comments from v2 that was not addressed:
>
> * Minor spelling nits
> * Breaking DIRECT_CALL, and include Puranjay's CALL_OPS work in the
> same series for DIRECT_CALL, to avoid breakage.

Yes, FTRACE_WITH_DIRECT_CALLS is currently broken. If I try to insmod
samples/ftrace/ftrace-direct.ko, it reports a failure:

[ 179.531472] ------------[ ftrace bug ]------------
[ 179.531761] ftrace failed to modify
[ 179.531786] [<ffffffff8005f9ac>] wake_up_process+0x0/0x24
[ 179.532577] actual: 97:e2:fa:ff:13:00:00:00
[ 179.533211] Setting ftrace call site to call ftrace function
[ 179.534409] ftrace record flags: 99980001
[ 179.534692] (1) tramp: ftrace_caller+0x0/0x34
(call_direct_funcs+0x0/0x14)
[ 179.534692] expected tramp: ffffffff01b0d000
...

>
> I'll have a look at the barriers (which came up at plumbers)!

Thank you!
After this series and the CALL_OPS work are done, dynamic Ftrace for
RISC-V will be even more valuable in production use cases.

>
>
> Cheers,
> Björn
>

Regards,
Evgenii