On Mon, 5 Feb 2024 at 03:54, Yafang Shao <laoar.shao@xxxxxxxxx> wrote: > > On Mon, Feb 5, 2024 at 7:02 AM Kumar Kartikeya Dwivedi <memxor@xxxxxxxxx> wrote: > > > > Add selftests covering the following cases: > > - A static subprog called from within a RCU read section works > > - A static subprog taking an RCU read lock which is released in caller works > > - A static subprog releasing the caller's RCU read lock works > > Given the global subprog is not allowed, we'd better add failure > cases for a global subprog. > I will add tests for global subprogs, but just to be clear, it's not that they are disallowed, but that the verifier won't be able to see whether their caller holds an RCU read lock or not. Therefore, it would be similar to how the main subprog is verified, in the verifier state for them active_rcu_lock will be false, and whatever that entails will follow. They can be called within an RCU read section, but they can't leave the lock in an imbalanced state on exit. > [...]