bpf: Add KF_SPINLOCK_SAFE flag for kfuncs under bpf_spin_lock

Introduce the KF_SPINLOCK_SAFE kfunc metadata flag in BTF so kfuncs may
be explicitly marked as safe to call while holding bpf_spin_lock.

Allow kfuncs defined in kernel modules to be marked with KF_SPINLOCK_SAFE.

Example: BTF_ID_FLAGS(func, $kfunc_name, KF_SPINLOCK_SAFE)

Signed-off-by: Kaitao Cheng <chengkaitao@kylinos.cn>
Acked-by: Leon Hwang <leon.hwang@linux.dev>
Link: https://lore.kernel.org/bpf/20260805153340.34776-2-kaitao.cheng@linux.dev
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
This commit is contained in:
Kaitao Cheng 2026-08-05 23:33:38 +08:00 • committed by Kumar Kartikeya Dwivedi
commit ed3b3093b6
No known key found for this signature in database
GPG key ID: 472D377B63542F83
2 changed files with 16 additions and 5 deletions