On architectures that don't use a syscall wrapper, sys_* function names
are set as an alias of __se_sys_* functions. Due to this, there is no
BTF associated with sys_* function names. This results in some of the
test progs failing to load. Set the SYS_PREFIX to "__se_" to fix this
issue.
Fixes: 38261f369f
("selftests/bpf: Fix probe_user test failure with clang build kernel")
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/013d632aacd3e41290445c0025db6a7055ec6e18.1643973917.git.naveen.n.rao@linux.vnet.ibm.com
19 lines
426 B
C
19 lines
426 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __BPF_MISC_H__
|
|
#define __BPF_MISC_H__
|
|
|
|
#if defined(__TARGET_ARCH_x86)
|
|
#define SYSCALL_WRAPPER 1
|
|
#define SYS_PREFIX "__x64_"
|
|
#elif defined(__TARGET_ARCH_s390)
|
|
#define SYSCALL_WRAPPER 1
|
|
#define SYS_PREFIX "__s390x_"
|
|
#elif defined(__TARGET_ARCH_arm64)
|
|
#define SYSCALL_WRAPPER 1
|
|
#define SYS_PREFIX "__arm64_"
|
|
#else
|
|
#define SYSCALL_WRAPPER 0
|
|
#define SYS_PREFIX "__se_"
|
|
#endif
|
|
|
|
#endif
|