mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 01:53:29 +02:00
selftests/bpf: test the jited inline of bpf_get_current_task
Add the testcase for the jited inline of bpf_get_current_task(). Signed-off-by: Menglong Dong <dongml2@chinatelecom.cn> Acked-by: Eduard Zingerman <eddyz87@gmail.com> Link: https://lore.kernel.org/r/20260120070555.233486-3-dongml2@chinatelecom.cn Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
parent
eaedea154e
commit
4fca95095c
|
|
@ -112,6 +112,7 @@
|
|||
#include "verifier_xdp_direct_packet_access.skel.h"
|
||||
#include "verifier_bits_iter.skel.h"
|
||||
#include "verifier_lsm.skel.h"
|
||||
#include "verifier_jit_inline.skel.h"
|
||||
#include "irq.skel.h"
|
||||
|
||||
#define MAX_ENTRIES 11
|
||||
|
|
@ -255,6 +256,7 @@ void test_verifier_bits_iter(void) { RUN(verifier_bits_iter); }
|
|||
void test_verifier_lsm(void) { RUN(verifier_lsm); }
|
||||
void test_irq(void) { RUN(irq); }
|
||||
void test_verifier_mtu(void) { RUN(verifier_mtu); }
|
||||
void test_verifier_jit_inline(void) { RUN(verifier_jit_inline); }
|
||||
|
||||
static int init_test_val_map(struct bpf_object *obj, char *map_name)
|
||||
{
|
||||
|
|
|
|||
20
tools/testing/selftests/bpf/progs/verifier_jit_inline.c
Normal file
20
tools/testing/selftests/bpf/progs/verifier_jit_inline.c
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
#include <vmlinux.h>
|
||||
#include <bpf/bpf_helpers.h>
|
||||
#include "bpf_misc.h"
|
||||
|
||||
SEC("fentry/bpf_fentry_test1")
|
||||
__success __retval(0)
|
||||
__arch_x86_64
|
||||
__jited(" addq %gs:{{.*}}, %rax")
|
||||
__arch_arm64
|
||||
__jited(" mrs x7, SP_EL0")
|
||||
int inline_bpf_get_current_task(void)
|
||||
{
|
||||
bpf_get_current_task();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
char _license[] SEC("license") = "GPL";
|
||||
Loading…
Reference in New Issue
Block a user