From nobody Fri Jul 24 23:32:06 2026 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (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 DEBA33F4835; Wed, 22 Jul 2026 04:22:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784694152; cv=none; b=FRnwRSqcW4KYnpe6T/tWW1yC4REgyjE7BmBfjkbUHkEsnVAuIP5DOql7sp7BVz0L2KnLMz2J8ZOSQhPbBeFMEewVPDPCPM84WNBDGZsOFwiJzZiFPqCBTAA1VLO7PHnz0Di3/QT2KfOgTf5wN4CCbDjMEytY/lf0tTCSpIY7jHE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784694152; c=relaxed/simple; bh=JqXzocaaGkF3N10RX6FQY3lrIXzAVNfJPOKIDgIITCk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Day5aJMBvlXFUXuGeaJ6bKmSAcYbXsxe3GoH/TvlLvJNSDQgisvWokb8D3cLxSLVMG+3lj7QcAhwYy/bVgHLuGMoynZ/3GQDJc2sRajITL4ZJZFXTXOuy1lkExUSKB1bEjixmWGQ6nI2NIOKkTlQVcPvJvHfc0wKfnbJD8LoPow= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: ed854e0a858411f1aa26b74ffac11d73-20260722 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.12,REQID:c69b1278-8d44-4dc6-9e7e-1265e4e14337,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:e7bac3a,CLOUDID:9a3cfa686445791d6e234b324b41ec1a,BulkI D:nil,BulkQuantity:0,Recheck:0,SF:81|82|102|136|850|865|898,TC:nil,Content :0|15|50,EDM:-3,IP:nil,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 ,OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: ed854e0a858411f1aa26b74ffac11d73-20260722 X-User: jiangfeng@kylinos.cn Received: from [127.0.0.1] [(10.44.16.150)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256) with ESMTP id 801892114; Wed, 22 Jul 2026 12:22:19 +0800 From: Feng Jiang Date: Wed, 22 Jul 2026 04:21:25 +0000 Subject: [PATCH bpf-next v4 1/3] bpf, riscv: add support for timed may_goto Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260722-riscv-bpf-timed-may-goto-v4-1-e117e6337bc7@kylinos.cn> References: <20260722-riscv-bpf-timed-may-goto-v4-0-e117e6337bc7@kylinos.cn> In-Reply-To: <20260722-riscv-bpf-timed-may-goto-v4-0-e117e6337bc7@kylinos.cn> To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Eduard Zingerman , Kumar Kartikeya Dwivedi , Martin KaFai Lau , Song Liu , Yonghong Song , Jiri Olsa , Emil Tsalapatis , Luke Nelson , Xi Wang , =?utf-8?q?Bj=C3=B6rn_T=C3=B6pel?= , Pu Lehui , Puranjay Mohan , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Shuah Khan , Ihor Solodrai Cc: bpf@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Feng Jiang X-Mailer: b4 0.14.3 Implement arch_bpf_timed_may_goto() for the RV64 JIT. The argument and return value are carried in BPF_REG_AX, and BPF R0-R5 are preserved across the call to the generic bpf_check_timed_may_goto(). Enable bpf_jit_supports_timed_may_goto() so the verifier uses the timed expansion path. Signed-off-by: Feng Jiang --- arch/riscv/net/Makefile | 2 +- arch/riscv/net/bpf_jit_comp64.c | 12 +++++++++- arch/riscv/net/bpf_timed_may_goto.S | 47 +++++++++++++++++++++++++++++++++= ++++ 3 files changed, 59 insertions(+), 2 deletions(-) diff --git a/arch/riscv/net/Makefile b/arch/riscv/net/Makefile index 9a1e5f0a94e5..6458d4d51990 100644 --- a/arch/riscv/net/Makefile +++ b/arch/riscv/net/Makefile @@ -3,7 +3,7 @@ obj-$(CONFIG_BPF_JIT) +=3D bpf_jit_core.o =20 ifeq ($(CONFIG_ARCH_RV64I),y) - obj-$(CONFIG_BPF_JIT) +=3D bpf_jit_comp64.o + obj-$(CONFIG_BPF_JIT) +=3D bpf_jit_comp64.o bpf_timed_may_goto.o else obj-$(CONFIG_BPF_JIT) +=3D bpf_jit_comp32.o endif diff --git a/arch/riscv/net/bpf_jit_comp64.c b/arch/riscv/net/bpf_jit_comp6= 4.c index ad089a9a4ea9..8fe8969fb8a0 100644 --- a/arch/riscv/net/bpf_jit_comp64.c +++ b/arch/riscv/net/bpf_jit_comp64.c @@ -1841,7 +1841,12 @@ int bpf_jit_emit_insn(const struct bpf_insn *insn, s= truct rv_jit_context *ctx, if (aux->tail_call_reachable && insn->src_reg =3D=3D BPF_PSEUDO_CALL) emit_sd(RV_REG_SP, ctx->tcc_offset, RV_REG_TCC, ctx); =20 - if (insn->src_reg !=3D BPF_PSEUDO_CALL) + /* + * arch_bpf_timed_may_goto() is emitted by the verifier and + * returns its result in BPF_REG_AX instead of BPF_REG_0, so + * skip the normal "move return register into R0". + */ + if (insn->src_reg !=3D BPF_PSEUDO_CALL && addr !=3D (u64)arch_bpf_timed_= may_goto) emit_mv(bpf_to_rv_reg(BPF_REG_0, ctx), RV_REG_A0, ctx); break; } @@ -2161,3 +2166,8 @@ bool bpf_jit_supports_subprog_tailcalls(void) { return true; } + +bool bpf_jit_supports_timed_may_goto(void) +{ + return true; +} diff --git a/arch/riscv/net/bpf_timed_may_goto.S b/arch/riscv/net/bpf_timed= _may_goto.S new file mode 100644 index 000000000000..f4bf2cd10586 --- /dev/null +++ b/arch/riscv/net/bpf_timed_may_goto.S @@ -0,0 +1,47 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* Copyright (c) 2026 Feng Jiang */ + +#include +#include + +/* + * Trampoline for the BPF timed may_goto loop bound. Custom calling conven= tion: + * - input: stack offset in BPF_REG_AX (t0) + * - output: updated count in BPF_REG_AX (t0) + * + * Calls bpf_check_timed_may_goto(ptr) with the standard RISC-V ABI, where + * ptr =3D BPF_REG_FP (s5) + BPF_REG_AX (t0). BPF R0-R5 (a5, a0-a4) are sa= ved + * across the call; BPF_REG_FP (s5) is callee-saved and needs no saving. + */ + +SYM_FUNC_START(arch_bpf_timed_may_goto) + addi sp, sp, -64 + sd ra, 56(sp) + sd s0, 48(sp) + addi s0, sp, 64 + + /* Save BPF registers R0-R5 (a5, a0-a4) */ + sd a5, 40(sp) + sd a0, 32(sp) + sd a1, 24(sp) + sd a2, 16(sp) + sd a3, 8(sp) + sd a4, 0(sp) + + add a0, t0, s5 + call bpf_check_timed_may_goto + mv t0, a0 + + /* Restore BPF registers R0-R5 */ + ld a4, 0(sp) + ld a3, 8(sp) + ld a2, 16(sp) + ld a1, 24(sp) + ld a0, 32(sp) + ld a5, 40(sp) + + ld s0, 48(sp) + ld ra, 56(sp) + addi sp, sp, 64 + ret +SYM_FUNC_END(arch_bpf_timed_may_goto) --=20 2.53.0 From nobody Fri Jul 24 23:32:06 2026 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (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 7B43B3F54BB; Wed, 22 Jul 2026 04:22:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784694154; cv=none; b=tD07W6Fx4OxXXpxN4yaiGUUNxocmmywzYSnUN4W/gYHegdr9CabAOtT3yeI0NsjSZJhErNaqKopcfzbnXHFkV5CzAKU8LSamYfe/2VD2Su1I3btaepFHACndgnpQUvpQsWn6eO2r8AM06F7+abrj2MAP2GEyqRZdt0K5/JNBOjc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784694154; c=relaxed/simple; bh=tKpQCI2hjB9vJ8beag2fBE5vsYdC4AMP+S40MicYuT4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oOFL9uXPF3w+mjp5wOQ/Lr37ZRZ20ds8ym4ATaGxGZWWiT+E/ExvtTxBKDugI01lGIzcolNnbBbT3s2X+3WYETkYlPg3ywJXi67NRsjiKB4plvZ5K0p/YsUufeksO012SCS1ix57u+xk9Zc6epL+sKCk/NwtnnaIDURmYBYg23Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: ee00001e858411f1aa26b74ffac11d73-20260722 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.12,REQID:04bc7097-28d8-463e-bc6f-8cdbd283aaee,IP:0,U RL:0,TC:0,Content:0,EDM:-25,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:-25 X-CID-META: VersionHash:e7bac3a,CLOUDID:22ab38201f7b7bd866b0b3e1c80da476,BulkI D:nil,BulkQuantity:0,Recheck:0,SF:81|82|102|850|865|898,TC:nil,Content:0|1 5|50,EDM:2,IP:nil,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI: 0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: ee00001e858411f1aa26b74ffac11d73-20260722 X-User: jiangfeng@kylinos.cn Received: from [127.0.0.1] [(10.44.16.150)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256) with ESMTP id 88347879; Wed, 22 Jul 2026 12:22:20 +0800 From: Feng Jiang Date: Wed, 22 Jul 2026 04:21:26 +0000 Subject: [PATCH bpf-next v4 2/3] selftests/bpf: test timed may_goto preserves R0-R5 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260722-riscv-bpf-timed-may-goto-v4-2-e117e6337bc7@kylinos.cn> References: <20260722-riscv-bpf-timed-may-goto-v4-0-e117e6337bc7@kylinos.cn> In-Reply-To: <20260722-riscv-bpf-timed-may-goto-v4-0-e117e6337bc7@kylinos.cn> To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Eduard Zingerman , Kumar Kartikeya Dwivedi , Martin KaFai Lau , Song Liu , Yonghong Song , Jiri Olsa , Emil Tsalapatis , Luke Nelson , Xi Wang , =?utf-8?q?Bj=C3=B6rn_T=C3=B6pel?= , Pu Lehui , Puranjay Mohan , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Shuah Khan , Ihor Solodrai Cc: bpf@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Feng Jiang X-Mailer: b4 0.14.3 Add a test that checks R0-R5 are preserved across arch_bpf_timed_may_goto() calls. Use bpf_get_prandom_u32() to avoid the verifier removing the checks via DCE. Suggested-by: Bj=C3=B6rn T=C3=B6pel Signed-off-by: Feng Jiang --- .../selftests/bpf/progs/verifier_may_goto_1.c | 57 ++++++++++++++++++= ++++ 1 file changed, 57 insertions(+) diff --git a/tools/testing/selftests/bpf/progs/verifier_may_goto_1.c b/tool= s/testing/selftests/bpf/progs/verifier_may_goto_1.c index 4bdf4256a41e..98d59108d097 100644 --- a/tools/testing/selftests/bpf/progs/verifier_may_goto_1.c +++ b/tools/testing/selftests/bpf/progs/verifier_may_goto_1.c @@ -106,4 +106,61 @@ __naked void may_goto_batch_2(void) : __clobber_all); } =20 +/* + * Use bpf_get_prandom_u32() to prevent DCE from removing the checks. + * retval: 0=3Dall ok, 1-6=3DR0-R5 clobbered. + */ +SEC("raw_tp") +__description("timed may_goto preserves R0-R5") +__arch_x86_64 +__arch_arm64 +__arch_riscv64 +__success +__retval(0) +__naked void timed_may_goto_preserves_regs(void) +{ + asm volatile ( + "call %[bpf_get_prandom_u32];" + "r6 =3D r0;" + "r0 =3D 0x1111;" + "r0 +=3D r6;" + "r1 =3D 0x2222;" + "r1 +=3D r6;" + "r2 =3D 0x3333;" + "r2 +=3D r6;" + "r3 =3D 0x4444;" + "r3 +=3D r6;" + "r4 =3D 0x5555;" + "r4 +=3D r6;" + "r5 =3D 0x6666;" + "r5 +=3D r6;" + ".8byte %[may_goto];" + ".8byte %[loop];" + "r0 -=3D r6;" + "r1 -=3D r6;" + "r2 -=3D r6;" + "r3 -=3D r6;" + "r4 -=3D r6;" + "r5 -=3D r6;" + "if r0 !=3D 0x1111 goto 1f;" + "if r1 !=3D 0x2222 goto 2f;" + "if r2 !=3D 0x3333 goto 3f;" + "if r3 !=3D 0x4444 goto 4f;" + "if r4 !=3D 0x5555 goto 5f;" + "if r5 !=3D 0x6666 goto 6f;" + "r0 =3D 0;" + "exit;" + "1: r0 =3D 1; exit;" + "2: r0 =3D 2; exit;" + "3: r0 =3D 3; exit;" + "4: r0 =3D 4; exit;" + "5: r0 =3D 5; exit;" + "6: r0 =3D 6; exit;" + : + : __imm(bpf_get_prandom_u32), + __imm_insn(may_goto, BPF_RAW_INSN(BPF_JMP | BPF_JCOND, 0, 0, 1, 0)), + __imm_insn(loop, BPF_RAW_INSN(BPF_JMP | BPF_JA, 0, 0, -2, 0)) + : __clobber_all); +} + char _license[] SEC("license") =3D "GPL"; --=20 2.53.0 From nobody Fri Jul 24 23:32:06 2026 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (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 CB7C73FFAC0; Wed, 22 Jul 2026 04:22:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784694153; cv=none; b=E0t5a1DhuAQ0YSS6pCpbFhK9e7A3HBLAEcTwLsVCc2J5u52bhnZ0vSKol3eJB/6L24dCRtbChAbOujl5FEaktb8UNamulyi80L1bRUKsBoeBzlPm13xJGREq67BW8JmuUJ0hyRTy/mdBHZJWigzG52u53j9NMCqs6MMftoCDQSY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784694153; c=relaxed/simple; bh=4SHZenHKTKuh/z6BGoOwqik3+aQVJ0TvA2yD0tzD2uc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NCOe2TMD3M/Y/AVcfdkvu2pSTC4BMRmJAqysd9nbKlYHFSpF0CqmYs37u9qyD7A1XD3ru5hVkpzbQAvJd2m0v1EN8hxv7j+bibY2P0O0A5bnT1UDWSHRfs4UPNH7a6o59+9dwHoJpvB0QnIMRo8zKWiAfIZ/Ok3c1+ADTSPUjlA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: ee79ae82858411f1aa26b74ffac11d73-20260722 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.12,REQID:611d3895-887a-4cdb-82e3-ad7162b625c1,IP:0,U RL:0,TC:0,Content:0,EDM:-25,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:-25 X-CID-META: VersionHash:e7bac3a,CLOUDID:43214d0268c10d7bf491e10900a4f1a1,BulkI D:nil,BulkQuantity:0,Recheck:0,SF:81|82|102|850|865|898,TC:nil,Content:0|1 5|50,EDM:2,IP:nil,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI: 0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: ee79ae82858411f1aa26b74ffac11d73-20260722 X-User: jiangfeng@kylinos.cn Received: from [127.0.0.1] [(10.44.16.150)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256) with ESMTP id 470154039; Wed, 22 Jul 2026 12:22:20 +0800 From: Feng Jiang Date: Wed, 22 Jul 2026 04:21:27 +0000 Subject: [PATCH bpf-next v4 3/3] selftests/bpf: enable timed may_goto tests for riscv64 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260722-riscv-bpf-timed-may-goto-v4-3-e117e6337bc7@kylinos.cn> References: <20260722-riscv-bpf-timed-may-goto-v4-0-e117e6337bc7@kylinos.cn> In-Reply-To: <20260722-riscv-bpf-timed-may-goto-v4-0-e117e6337bc7@kylinos.cn> To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Eduard Zingerman , Kumar Kartikeya Dwivedi , Martin KaFai Lau , Song Liu , Yonghong Song , Jiri Olsa , Emil Tsalapatis , Luke Nelson , Xi Wang , =?utf-8?q?Bj=C3=B6rn_T=C3=B6pel?= , Pu Lehui , Puranjay Mohan , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Shuah Khan , Ihor Solodrai Cc: bpf@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Feng Jiang X-Mailer: b4 0.14.3 Enable verifier_may_goto_1 (raw instruction tests), stream_cond_break (250ms timeout path), and the may_goto_interaction fastcall test on riscv64 now that the JIT supports timed may_goto. Signed-off-by: Feng Jiang Reviewed-by: Pu Lehui --- tools/testing/selftests/bpf/progs/stream.c | 1 + tools/testing/selftests/bpf/progs/verifier_bpf_fastcall.c | 3 ++- tools/testing/selftests/bpf/progs/verifier_may_goto_1.c | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/progs/stream.c b/tools/testing/sel= ftests/bpf/progs/stream.c index 92ba1d72e0ec..8d8e53d37266 100644 --- a/tools/testing/selftests/bpf/progs/stream.c +++ b/tools/testing/selftests/bpf/progs/stream.c @@ -64,6 +64,7 @@ SEC("syscall") __arch_x86_64 __arch_arm64 __arch_s390x +__arch_riscv64 __success __retval(0) __stderr("ERROR: Timeout detected for may_goto instruction") __stderr("CPU: {{[0-9]+}} UID: 0 PID: {{[0-9]+}} Comm: {{.*}}") diff --git a/tools/testing/selftests/bpf/progs/verifier_bpf_fastcall.c b/to= ols/testing/selftests/bpf/progs/verifier_bpf_fastcall.c index 8d7ff38e4c06..83707faea049 100644 --- a/tools/testing/selftests/bpf/progs/verifier_bpf_fastcall.c +++ b/tools/testing/selftests/bpf/progs/verifier_bpf_fastcall.c @@ -660,6 +660,7 @@ __naked void may_goto_interaction_x86_64(void) =20 SEC("raw_tp") __arch_arm64 +__arch_riscv64 __log_level(4) __msg("stack depth 24") /* may_goto counter at -24 */ __xlated("0: *(u64 *)(r10 -24) =3D") @@ -679,7 +680,7 @@ __xlated("10: *(u64 *)(r10 -24) =3D r12") __xlated("11: *(u64 *)(r10 -8) =3D r1") __xlated("12: exit") __success -__naked void may_goto_interaction_arm64(void) +__naked void may_goto_interaction(void) { asm volatile ( "r1 =3D 1;" diff --git a/tools/testing/selftests/bpf/progs/verifier_may_goto_1.c b/tool= s/testing/selftests/bpf/progs/verifier_may_goto_1.c index 98d59108d097..97129d2730a0 100644 --- a/tools/testing/selftests/bpf/progs/verifier_may_goto_1.c +++ b/tools/testing/selftests/bpf/progs/verifier_may_goto_1.c @@ -11,6 +11,7 @@ __description("may_goto 0") __arch_x86_64 __arch_s390x __arch_arm64 +__arch_riscv64 __xlated("0: r0 =3D 1") __xlated("1: exit") __success @@ -31,6 +32,7 @@ __description("batch 2 of may_goto 0") __arch_x86_64 __arch_s390x __arch_arm64 +__arch_riscv64 __xlated("0: r0 =3D 1") __xlated("1: exit") __success @@ -53,6 +55,7 @@ __description("may_goto batch with offsets 2/1/0") __arch_x86_64 __arch_s390x __arch_arm64 +__arch_riscv64 __xlated("0: r0 =3D 1") __xlated("1: exit") __success @@ -79,6 +82,7 @@ __description("may_goto batch with offsets 2/0") __arch_x86_64 __arch_s390x __arch_arm64 +__arch_riscv64 __xlated("0: *(u64 *)(r10 -16) =3D 65535") __xlated("1: *(u64 *)(r10 -8) =3D 0") __xlated("2: r12 =3D *(u64 *)(r10 -16)") --=20 2.53.0