Files
linux/arch/s390/kernel/bpf.c
Ilya Leoshkevich 6fe54677bc s390: Introduce bpf_get_lowcore() kfunc
Implementing BPF version of preempt_count() requires accessing lowcore
from BPF. Since lowcore can be relocated, open-coding
(struct lowcore *)0 does not work, so add a kfunc.

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Link: https://lore.kernel.org/r/20260217160813.100855-2-iii@linux.ibm.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2026-03-03 08:35:07 -08:00

13 lines
214 B
C

// SPDX-License-Identifier: GPL-2.0
#include <asm/lowcore.h>
#include <linux/btf.h>
__bpf_kfunc_start_defs();
__bpf_kfunc struct lowcore *bpf_get_lowcore(void)
{
return get_lowcore();
}
__bpf_kfunc_end_defs();