From nobody Sat Feb 7 17:55:19 2026 Received: from out-179.mta0.migadu.com (out-179.mta0.migadu.com [91.218.175.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 317C8369220 for ; Wed, 28 Jan 2026 15:02:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769612532; cv=none; b=OhG6jlCL1hR/FKZIaq5kOA0JtQyKoVZTMibU6EUrDk5o5I2zYThF2PcG6vCMAD5xRRlll+2Lfrk2mWQ/zqzRz6CjUPoCD+2rVKMtovldP107bLGmvRjEQLSbPXEl3Kum3t90rSeE5sKl8gIxbFHJK89T/nQmqbHvXhvWZ/D2SC0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769612532; c=relaxed/simple; bh=lUZHuuWARG0DTUNrfcxR6s+uCFVTt5vXdXNOvLssSSQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mH00knVo5zMPIJ2o3/HwGLbFmjAr/fUYKe5Gql4LmwSDnuqtYDJVLlGr7p1TgB+YTiOZRlbr7TFughIP1y4JF+LLASiEKJaEijSeYGGNTuatlN1PIBZgFa81obzBZGBbpgaaHENEZNPgn9iwMd4KL7ms3I6OcNnh/uiPTYWITvQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=FKINyKn/; arc=none smtp.client-ip=91.218.175.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="FKINyKn/" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1769612509; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2xms8qScC7+REkQSTKJnxMsp60camdO11DeRVL9RJUs=; b=FKINyKn/YA+c/RNTorxytEVB1s1o7BRoXRElT2rjhByDd9K2p9stmFbU5GWgKvGVCpkFou vDJPuyAJYo6ss40/UPbx4/IrtPeUTqzgrI4BtyV/89GLQqRQERY9Yw8qXsmNF1dNBjWA5b hgR0qhGlhoAVuajBTxhL3tLkjGL8akk= From: Leon Hwang To: bpf@vger.kernel.org Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Puranjay Mohan , Xu Kuohai , Catalin Marinas , Will Deacon , Shuah Khan , Menglong Dong , Leon Hwang , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kernel-patches-bot@fb.com Subject: [PATCH bpf-next v2 1/3] bpf: Add bpf_arch_supports_fsession() Date: Wed, 28 Jan 2026 23:01:10 +0800 Message-ID: <20260128150112.8873-2-leon.hwang@linux.dev> In-Reply-To: <20260128150112.8873-1-leon.hwang@linux.dev> References: <20260128150112.8873-1-leon.hwang@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" fsession programs can currently be loaded on architectures that do not implement fsession support, which leads to runtime errors instead of a clean verifier rejection. For example, running fsession selftests on arm64 before fsession support is added results in: test_fsession_basic:PASS:fsession_test__open_and_load 0 nsec test_fsession_basic:PASS:fsession_attach 0 nsec check_result:FAIL:test_run_opts err unexpected error: -14 (errno 14) Introduce bpf_arch_supports_fsession() to explicitly gate fsession usage based on architecture support. Architectures without fsession support will now fail program load with -EOPNOTSUPP, allowing selftests to skip cleanly instead of errors at runtime. x86 declares fsession support, while the default implementation returns false. Fixes: 2d419c44658f ("bpf: add fsession support") Signed-off-by: Leon Hwang Acked-by: Puranjay Mohan Tested-by: Puranjay Mohan --- arch/x86/net/bpf_jit_comp.c | 5 +++ include/linux/filter.h | 1 + kernel/bpf/core.c | 5 +++ kernel/bpf/verifier.c | 3 ++ .../selftests/bpf/prog_tests/fsession_test.c | 32 ++++++++++++++----- 5 files changed, 38 insertions(+), 8 deletions(-) diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c index 5a075e06cf45..070ba80e39d7 100644 --- a/arch/x86/net/bpf_jit_comp.c +++ b/arch/x86/net/bpf_jit_comp.c @@ -4112,3 +4112,8 @@ bool bpf_jit_supports_timed_may_goto(void) { return true; } + +bool bpf_jit_supports_fsession(void) +{ + return true; +} diff --git a/include/linux/filter.h b/include/linux/filter.h index fd54fed8f95f..4e1cb4f91f49 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h @@ -1167,6 +1167,7 @@ bool bpf_jit_supports_arena(void); bool bpf_jit_supports_insn(struct bpf_insn *insn, bool in_arena); bool bpf_jit_supports_private_stack(void); bool bpf_jit_supports_timed_may_goto(void); +bool bpf_jit_supports_fsession(void); u64 bpf_arch_uaddress_limit(void); void arch_bpf_stack_walk(bool (*consume_fn)(void *cookie, u64 ip, u64 sp, = u64 bp), void *cookie); u64 arch_bpf_timed_may_goto(void); diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c index e0b8a8a5aaa9..3b1eb632bf7c 100644 --- a/kernel/bpf/core.c +++ b/kernel/bpf/core.c @@ -3142,6 +3142,11 @@ bool __weak bpf_jit_supports_insn(struct bpf_insn *i= nsn, bool in_arena) return false; } =20 +bool __weak bpf_jit_supports_fsession(void) +{ + return false; +} + u64 __weak bpf_arch_uaddress_limit(void) { #if defined(CONFIG_64BIT) && defined(CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRE= SS_SPACE) diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index c2f2650db9fd..6f867ebf78d1 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -24872,6 +24872,9 @@ int bpf_check_attach_target(struct bpf_verifier_log= *log, case BPF_TRACE_FENTRY: case BPF_TRACE_FEXIT: case BPF_TRACE_FSESSION: + if (prog->expected_attach_type =3D=3D BPF_TRACE_FSESSION && + !bpf_jit_supports_fsession()) + return -EOPNOTSUPP; if (!btf_type_is_func(t)) { bpf_log(log, "attach_btf_id %u is not a function\n", btf_id); diff --git a/tools/testing/selftests/bpf/prog_tests/fsession_test.c b/tools= /testing/selftests/bpf/prog_tests/fsession_test.c index 0c4b428e1cee..a299aeb8cc2e 100644 --- a/tools/testing/selftests/bpf/prog_tests/fsession_test.c +++ b/tools/testing/selftests/bpf/prog_tests/fsession_test.c @@ -29,8 +29,16 @@ static void test_fsession_basic(void) struct fsession_test *skel =3D NULL; int err; =20 - skel =3D fsession_test__open_and_load(); - if (!ASSERT_OK_PTR(skel, "fsession_test__open_and_load")) + skel =3D fsession_test__open(); + if (!ASSERT_OK_PTR(skel, "fsession_test__open")) + return; + + err =3D fsession_test__load(skel); + if (err =3D=3D -EOPNOTSUPP) { + test__skip(); + goto cleanup; + } + if (!ASSERT_OK(err, "fsession_test__load")) goto cleanup; =20 err =3D fsession_test__attach(skel); @@ -47,8 +55,16 @@ static void test_fsession_reattach(void) struct fsession_test *skel =3D NULL; int err; =20 - skel =3D fsession_test__open_and_load(); - if (!ASSERT_OK_PTR(skel, "fsession_test__open_and_load")) + skel =3D fsession_test__open(); + if (!ASSERT_OK_PTR(skel, "fsession_test__open")) + return; + + err =3D fsession_test__load(skel); + if (err =3D=3D -EOPNOTSUPP) { + test__skip(); + goto cleanup; + } + if (!ASSERT_OK(err, "fsession_test__load")) goto cleanup; =20 /* first attach */ @@ -94,6 +110,10 @@ static void test_fsession_cookie(void) bpf_program__set_autoload(skel->progs.test6, false); =20 err =3D fsession_test__load(skel); + if (err =3D=3D -EOPNOTSUPP) { + test__skip(); + goto cleanup; + } if (!ASSERT_OK(err, "fsession_test__load")) goto cleanup; =20 @@ -111,10 +131,6 @@ static void test_fsession_cookie(void) =20 void test_fsession_test(void) { -#if !defined(__x86_64__) - test__skip(); - return; -#endif if (test__start_subtest("fsession_test")) test_fsession_basic(); if (test__start_subtest("fsession_reattach")) --=20 2.52.0 From nobody Sat Feb 7 17:55:19 2026 Received: from out-181.mta0.migadu.com (out-181.mta0.migadu.com [91.218.175.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2F93E369232 for ; Wed, 28 Jan 2026 15:02:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769612551; cv=none; b=aqu+fwH4l72MDncX9QzWH/YOqmAt7nPhxxxiSDn3n6cLd96mfnUetzOTGud+LImpQiXpEtzCYYq0AB8cLhQbo78zGpfP9MNj9f1U2TiswCJedonA2zEiarLttjqdlYZESd8s3phR0FrItK1ekmtngivKBtGDtmYd2pMnw7fynr0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769612551; c=relaxed/simple; bh=uJ3J8FWaFsHsVCMqFgJehh03QgtLSJV2Q8xJxgwzKUY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FaCkmvkjaos7PgYyFnwUuT+bHl9JbcCT9+5mcKqpsDW8sjEQIEXfNS/BZRuJbUKQb+2d8foWCvOYcmS2OQDD57rMU9Drm3abPVZTXhnigcNKNtWEWFlued2gI/SdiViQVNc1xgojykPiOUifUcfG4Le72pQzi6ZrcVYO7cnLRAg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=K8wCfwTa; arc=none smtp.client-ip=91.218.175.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="K8wCfwTa" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1769612533; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5KsRsvGl58QXwzZ3EI8wULjyrtB8jnovAYpvg7DJrhs=; b=K8wCfwTaZV+7SwVaASBDvcAp6W7OXpak9sznfwGI9X8arhLNGJBAWMvErhIBF2d5J6p+zA nw56ZPyqJZo5Vq2ZSFn/5QVu1vGoGbiLup/zHvmCGYVKPoERsHpcTaJFZCtXiGPV7hr0XD 9FT1jQinsDyfmsh54WZJz2k/YGewomY= From: Leon Hwang To: bpf@vger.kernel.org Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Puranjay Mohan , Xu Kuohai , Catalin Marinas , Will Deacon , Shuah Khan , Menglong Dong , Leon Hwang , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kernel-patches-bot@fb.com Subject: [PATCH bpf-next v2 2/3] bpf, arm64: Add fsession support Date: Wed, 28 Jan 2026 23:01:11 +0800 Message-ID: <20260128150112.8873-3-leon.hwang@linux.dev> In-Reply-To: <20260128150112.8873-1-leon.hwang@linux.dev> References: <20260128150112.8873-1-leon.hwang@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Implement fsession support in the arm64 BPF JIT trampoline. Extend the trampoline stack layout to store function metadata and session cookies, and pass the appropriate metadata to fentry and fexit programs. This mirrors the existing x86 behavior and enables call session cookies on arm64. Signed-off-by: Leon Hwang Acked-by: Puranjay Mohan Tested-by: Puranjay Mohan --- arch/arm64/net/bpf_jit_comp.c | 71 ++++++++++++++++++++++++++++++----- include/linux/bpf.h | 7 +++- 2 files changed, 68 insertions(+), 10 deletions(-) diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c index 0c4d44bcfbf4..952e00e078b2 100644 --- a/arch/arm64/net/bpf_jit_comp.c +++ b/arch/arm64/net/bpf_jit_comp.c @@ -2510,6 +2510,12 @@ static bool is_struct_ops_tramp(const struct bpf_tra= mp_links *fentry_links) fentry_links->links[0]->link.type =3D=3D BPF_LINK_TYPE_STRUCT_OPS; } =20 +static void store_func_meta(struct jit_ctx *ctx, u64 func_meta, int func_m= eta_off) +{ + emit_a64_mov_i64(A64_R(10), func_meta, ctx); + emit(A64_STR64I(A64_R(10), A64_SP, func_meta_off), ctx); +} + /* Based on the x86's implementation of arch_prepare_bpf_trampoline(). * * bpf prog and function entry before bpf trampoline hooked: @@ -2533,7 +2539,7 @@ static int prepare_trampoline(struct jit_ctx *ctx, st= ruct bpf_tramp_image *im, int regs_off; int retval_off; int bargs_off; - int nfuncargs_off; + int func_meta_off; int ip_off; int run_ctx_off; int oargs_off; @@ -2544,6 +2550,9 @@ static int prepare_trampoline(struct jit_ctx *ctx, st= ruct bpf_tramp_image *im, bool save_ret; __le32 **branches =3D NULL; bool is_struct_ops =3D is_struct_ops_tramp(fentry); + int cookie_off, cookie_cnt, cookie_bargs_off; + int fsession_cnt =3D bpf_fsession_cnt(tlinks); + u64 func_meta; =20 /* trampoline stack layout: * [ parent ip ] @@ -2562,10 +2571,14 @@ static int prepare_trampoline(struct jit_ctx *ctx, = struct bpf_tramp_image *im, * [ ... ] * SP + bargs_off [ arg reg 1 ] for bpf * - * SP + nfuncargs_off [ arg regs count ] + * SP + func_meta_off [ regs count, etc ] * * SP + ip_off [ traced function ] BPF_TRAMP_F_IP_ARG flag * + * [ stack cookie N ] + * [ ... ] + * SP + cookie_off [ stack cookie 1 ] + * * SP + run_ctx_off [ bpf_tramp_run_ctx ] * * [ stack arg N ] @@ -2582,13 +2595,18 @@ static int prepare_trampoline(struct jit_ctx *ctx, = struct bpf_tramp_image *im, /* room for bpf_tramp_run_ctx */ stack_size +=3D round_up(sizeof(struct bpf_tramp_run_ctx), 8); =20 + cookie_off =3D stack_size; + /* room for session cookies */ + cookie_cnt =3D bpf_fsession_cookie_cnt(tlinks); + stack_size +=3D cookie_cnt * 8; + ip_off =3D stack_size; /* room for IP address argument */ if (flags & BPF_TRAMP_F_IP_ARG) stack_size +=3D 8; =20 - nfuncargs_off =3D stack_size; - /* room for args count */ + func_meta_off =3D stack_size; + /* room for function metadata, such as regs count */ stack_size +=3D 8; =20 bargs_off =3D stack_size; @@ -2646,9 +2664,9 @@ static int prepare_trampoline(struct jit_ctx *ctx, st= ruct bpf_tramp_image *im, emit(A64_STR64I(A64_R(10), A64_SP, ip_off), ctx); } =20 - /* save arg regs count*/ - emit(A64_MOVZ(1, A64_R(10), nfuncargs, 0), ctx); - emit(A64_STR64I(A64_R(10), A64_SP, nfuncargs_off), ctx); + /* save function metadata */ + func_meta =3D nfuncargs; + store_func_meta(ctx, func_meta, func_meta_off); =20 /* save args for bpf */ save_args(ctx, bargs_off, oargs_off, m, a, false); @@ -2666,10 +2684,27 @@ static int prepare_trampoline(struct jit_ctx *ctx, = struct bpf_tramp_image *im, emit_call((const u64)__bpf_tramp_enter, ctx); } =20 - for (i =3D 0; i < fentry->nr_links; i++) + if (fsession_cnt) { + /* clear all the session cookies' value */ + emit(A64_MOVZ(1, A64_R(10), 0, 0), ctx); + for (int i =3D 0; i < cookie_cnt; i++) + emit(A64_STR64I(A64_R(10), A64_SP, cookie_off + 8 * i), ctx); + /* clear the return value to make sure fentry always gets 0 */ + emit(A64_STR64I(A64_R(10), A64_SP, retval_off), ctx); + } + + cookie_bargs_off =3D (bargs_off - cookie_off) / 8; + for (i =3D 0; i < fentry->nr_links; i++) { + if (bpf_link_prog_session_cookie(fentry->links[i])) { + u64 meta =3D func_meta | (cookie_bargs_off << BPF_TRAMP_COOKIE_INDEX_SH= IFT); + + store_func_meta(ctx, meta, func_meta_off); + cookie_bargs_off--; + } invoke_bpf_prog(ctx, fentry->links[i], bargs_off, retval_off, run_ctx_off, flags & BPF_TRAMP_F_RET_FENTRY_RET); + } =20 if (fmod_ret->nr_links) { branches =3D kcalloc(fmod_ret->nr_links, sizeof(__le32 *), @@ -2701,9 +2736,22 @@ static int prepare_trampoline(struct jit_ctx *ctx, s= truct bpf_tramp_image *im, *branches[i] =3D cpu_to_le32(A64_CBNZ(1, A64_R(10), offset)); } =20 - for (i =3D 0; i < fexit->nr_links; i++) + /* set the "is_return" flag for fsession */ + func_meta |=3D (1ULL << BPF_TRAMP_IS_RETURN_SHIFT); + if (fsession_cnt) + store_func_meta(ctx, func_meta, func_meta_off); + + cookie_bargs_off =3D (bargs_off - cookie_off) / 8; + for (i =3D 0; i < fexit->nr_links; i++) { + if (bpf_link_prog_session_cookie(fexit->links[i])) { + u64 meta =3D func_meta | (cookie_bargs_off << BPF_TRAMP_COOKIE_INDEX_SH= IFT); + + store_func_meta(ctx, meta, func_meta_off); + cookie_bargs_off--; + } invoke_bpf_prog(ctx, fexit->links[i], bargs_off, retval_off, run_ctx_off, false); + } =20 if (flags & BPF_TRAMP_F_CALL_ORIG) { im->ip_epilogue =3D ctx->ro_image + ctx->idx; @@ -2753,6 +2801,11 @@ static int prepare_trampoline(struct jit_ctx *ctx, s= truct bpf_tramp_image *im, return ctx->idx; } =20 +bool bpf_jit_supports_fsession(void) +{ + return true; +} + int arch_bpf_trampoline_size(const struct btf_func_model *m, u32 flags, struct bpf_tramp_links *tlinks, void *func_addr) { diff --git a/include/linux/bpf.h b/include/linux/bpf.h index 4427c6e98331..b299d1206bfc 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h @@ -2192,13 +2192,18 @@ static inline int bpf_fsession_cnt(struct bpf_tramp= _links *links) return cnt; } =20 +static inline bool bpf_link_prog_session_cookie(struct bpf_tramp_link *lin= k) +{ + return link->link.prog->call_session_cookie; +} + static inline int bpf_fsession_cookie_cnt(struct bpf_tramp_links *links) { struct bpf_tramp_links fentries =3D links[BPF_TRAMP_FENTRY]; int cnt =3D 0; =20 for (int i =3D 0; i < links[BPF_TRAMP_FENTRY].nr_links; i++) { - if (fentries.links[i]->link.prog->call_session_cookie) + if (bpf_link_prog_session_cookie(fentries.links[i])) cnt++; } =20 --=20 2.52.0 From nobody Sat Feb 7 17:55:19 2026 Received: from out-183.mta1.migadu.com (out-183.mta1.migadu.com [95.215.58.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4DB15369999 for ; Wed, 28 Jan 2026 15:03:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.183 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769612595; cv=none; b=CJO4geTuLnkwjWXYfDRfJIZDbt+hOkSvQPdzsnHZ5RsgCGZ0YOabEP8s+mYeDhI6cFKbgZOiza8TuxOgB8YvuRZ8z9lZopTTmsO5j0uTPAXupxIW3ynrImo7tWc1esTlEU/DedbZvCt4vMJee2SF38zEtWTYHGX27kj11F/e7bE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769612595; c=relaxed/simple; bh=OWA1YjMlbP6yBecEmzg+WV4nt0CAwrahfMEwVc/TD8o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Oke8rS9Z1NFv70hzbiXvg10kdGeJ1T3rijFUj7va6mh9xWg/3J7cE/fJmvEky8v+dFLZ/M1mW/OhwcW6eCJMV9NUHvkO0gDQ/kwLMchxgV4YFfyBItL1FXNni7jRwxOiqzJrohs3icE0KBv/2REZ+n2ktsGGfs4nXrygqf3fXS8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=YgizllKU; arc=none smtp.client-ip=95.215.58.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="YgizllKU" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1769612587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oUoEHsnonw/X1gF+pNDCWHBKb2h1ueBFFTn7C++64W4=; b=YgizllKUStdsTkFhhKJFPYu0nNN1z0IDe5B1HoMN0LGs9j4TgAOyi7gM58BHzMdIR1hbbA dETBH5RFRniJjqQvGRV711yH0D6LgaHhlrkB62suVi5UWFF7fl693EFQMmsih/cfX1b9Yz pbFoeZQmZ0L6KuE4wpIyHcLW416o3EQ= From: Leon Hwang To: bpf@vger.kernel.org Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Puranjay Mohan , Xu Kuohai , Catalin Marinas , Will Deacon , Shuah Khan , Menglong Dong , Leon Hwang , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kernel-patches-bot@fb.com Subject: [PATCH bpf-next v2 3/3] bpf/selftests: Enable get_func_args and get_func_ip tests on arm64 Date: Wed, 28 Jan 2026 23:01:12 +0800 Message-ID: <20260128150112.8873-4-leon.hwang@linux.dev> In-Reply-To: <20260128150112.8873-1-leon.hwang@linux.dev> References: <20260128150112.8873-1-leon.hwang@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Allow get_func_args, and get_func_ip selftests to run on arm64. Signed-off-by: Leon Hwang Acked-by: Puranjay Mohan Tested-by: Puranjay Mohan --- tools/testing/selftests/bpf/progs/get_func_args_test.c | 2 +- tools/testing/selftests/bpf/progs/get_func_ip_test.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/bpf/progs/get_func_args_test.c b/tools= /testing/selftests/bpf/progs/get_func_args_test.c index 0a3236a7a109..180ba5098ca1 100644 --- a/tools/testing/selftests/bpf/progs/get_func_args_test.c +++ b/tools/testing/selftests/bpf/progs/get_func_args_test.c @@ -167,7 +167,7 @@ int BPF_PROG(tp_test2) } =20 __u64 test7_result =3D 0; -#ifdef __TARGET_ARCH_x86 +#if defined(bpf_target_x86) || defined(bpf_target_arm64) SEC("fsession/bpf_fentry_test1") int BPF_PROG(test7) { diff --git a/tools/testing/selftests/bpf/progs/get_func_ip_test.c b/tools/t= esting/selftests/bpf/progs/get_func_ip_test.c index 65f7e1f182bf..43ff836a8ed8 100644 --- a/tools/testing/selftests/bpf/progs/get_func_ip_test.c +++ b/tools/testing/selftests/bpf/progs/get_func_ip_test.c @@ -106,7 +106,7 @@ int BPF_URETPROBE(test8, int ret) =20 __u64 test9_entry_result =3D 0; __u64 test9_exit_result =3D 0; -#ifdef __TARGET_ARCH_x86 +#if defined(bpf_target_x86) || defined(bpf_target_arm64) SEC("fsession/bpf_fentry_test1") int BPF_PROG(test9, int a) { --=20 2.52.0