Re: [PATCH v3 0/7] riscv: ftrace: atmoic patching and preempt improvements
From: Björn Töpel
Date: Fri Dec 06 2024 - 03:39:33 EST
Evgenii Shatokhin <e.shatokhin@xxxxxxxxx> writes:
> On 03.12.2024 15:18, Björn Töpel wrote:
>> Andy!
>>
>> "atomic" spelling in the Subject line.
>>
>> Andy Chiu <andybnac@xxxxxxxxx> 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@xxxxxxxxxx/
>>
>> 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
> ...
And just a regular Ubuntu 24.10 will fail with all subsystems using BPF
trampoline, e.g.
------------[ ftrace bug ]------------
ftrace failed to modify
[<ffffffff80250d98>] bpf_lsm_file_open+0x0/0x1c
CALL_OPS with definitely a must for this series.
Björn