From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=124.71.94.104 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796131769; b=uGhTZ0uWIxsqk6VqIk6dJWzNVVK9T2NA19nN2Yq04sHamWOvlgTwHkrFBjPURbFRRwoa zVRcB7aIeboqAiau2GI0Ni7/BAYddSqugBFp6w1ZB9BKlCWTImYtEDHlSgSyRitdkSDLV Izog2joHtp9l2vjqJH93T41TWqkMRCqEbJu6yIQsVmsAigdnGX2Kw9Fw8sVEWp+ZKrqEF Xt2L4Zxbr2XyIrP0IPv5GU7pCBxN/PpFt3GSn4uQ5lhF7k/jV6Nx43vBc1GZvu8t0kSN+ Uryx9aLiblqBsQtqEfecJXhuGwS+D5Obt5MuRH+WFLqPqVNe/0pOubqTN4/DhxQMirg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796131769; h=DMARC-Filter:Received:Received:Received:From:To:Cc:Subject:Date: Message-Id:X-Mailer:MIME-Version:Content-Transfer-Encoding: X-CM-TRANSID:X-Coremail-Antispam:X-CM-SenderInfo; bh=3+VyYEKbgn/IylDU35XNgNOkC0Kygu6Ia75QVnjXjeQ=; b=mUkP0L/Nb8hU0T7E76mUeOfD/83YBqYRbe5QocEv+3DqVVnqkhR90JkgjNlJK+ORjYkk tt2uHJTXXIODAEr2sTW87TndzGQUOQmznjU3IUO8fdPqTfMkMp/7wCMxrD4iOK32ep0fT YpBrNAPlm0kgwNwCJS8r3l0U2kN70McXKVcPpIHLeZDKKX7zDfldC0DnwlCj09EqUK27e SAvYiebMk51sDsThmsUU8I/Znncb7UOTUDdvS3N04GZyEJ7B8ULtxKwrllnB8+ODpPhbP SXT7EG9wyq1ULmd9cYkPSlNQtzGEMkVeFAQ57Dlw1Zm5eqkw2dGchjAlEBYCgvtWjfA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.remote-ip=124.71.94.104 Received: from dggmsgout13.his.huawei.com (dggmsgout13.his.huawei.com [124.71.94.104]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E3876606A320; Tue, 1 Dec 2026 13:29:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E3876606A320 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.163.170]) by dggmsgout13.his.huawei.com (SkyGuard) with ESMTP id 4jf1v62z46z1rr2g; Tue, 1 Dec 2026 21:29:06 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.128]) by mail.maildlp.com (Postfix) with ESMTP id 909984056F; Tue, 1 Dec 2026 21:29:20 +0800 (CST) Received: from ultra.huawei.com (unknown [10.90.53.71]) by APP4 (Coremail) with UTF8SMTPA id gCh0CgCHveyvyw5roXYmGg--.32601S2; Tue, 01 Dec 2026 21:29:20 +0800 (CST) From: Pu Lehui To: =?UTF-8?q?Bj=C3=B6rn=20T=C3=B6pel?= , bpf@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Eduard Zingerman , Kumar Kartikeya Dwivedi , Martin KaFai Lau , Song Liu , Yonghong Song , Jiri Olsa , Emil Tsalapatis , Ihor Solodrai , Puranjay Mohan , Paul Walmsley , Palmer Dabbelt , Alexandre Ghiti , Pu Lehui , Pu Lehui Subject: [PATCH bpf-next 0/4] riscv, bpf: Miscellaneous JIT optimizations Date: Tue, 1 Dec 2026 13:34:00 +0000 Message-Id: <20261201133404.2227100-1-pulehui@huaweicloud.com> X-Mailer: git-send-email 2.34.1 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:gCh0CgCHveyvyw5roXYmGg--.32601S2 X-Coremail-Antispam: 1UD129KBjvJXoW7Kr17Jr4DXF13ZF15XrW7twb_yoW8Jw4DpF 4fKry3ZrykXr13Zws3JayUX3W3tr4ku3y3Xr47tryxZ3Z09ry2grn5Kw48uryakFyrXw1F vrn09r1rCw1kZ3DanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUU9j14x267AKxVW5JVWrJwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26r1j6r1xM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4j 6F4UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s 0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xII jxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr 1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7M4IIrI8v6xkF7I0E8cxa n2IY04v7MxkF7I0En4kS14v26r4a6rW5MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4 AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE 17CEb7AF67AKxVW8ZVWrXwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMI IF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4l IxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvf C2KfnxnUUI43ZEXa7sRidbbtUUUUU== X-CM-SenderInfo: psxovxtxl6x35dzhxuhorxvhhfrp/ From: Pu Lehui This series brings four improvements to the RISC-V BPF JIT: - Patch 1 fixes forward jump offset calculation across JIT passes so large programs (e.g. no_limits/dump) converge in 2 passes instead of hitting NR_JIT_ITERATIONS. - Patch 2 reuses the tailcall epilogue across multiple bpf_tail_call() sites on RV64 to shrink JIT image size. - Patch 3 introduces a per-image PLT on RV64 to eliminate stop_machine() in bpf_arch_text_poke(), reducing trampoline attach/detach latency. - Patch 4 removes the now-redundant RV64 arch_bpf_trampoline_skip() and 4-byte-aligns the skip nop in invoke_bpf_prog(). This series has been tested with riscv-bpf-daily and passed: https://github.com/pulehui/riscv-bpf-daily/pull/26 Pu Lehui (4): riscv, bpf: Fix forward jump offset calculation during JIT passes riscv, bpf: Reuse tailcall epilogue across tailcall sites riscv, bpf: Eliminate stop_machine in bpf_arch_text_poke with per-image PLT riscv, bpf: Remove arch_bpf_trampoline_skip arch/riscv/net/bpf_jit.h | 19 ++-- arch/riscv/net/bpf_jit_comp32.c | 5 +- arch/riscv/net/bpf_jit_comp64.c | 192 +++++++++++++++++++++++--------- arch/riscv/net/bpf_jit_core.c | 51 ++++----- 4 files changed, 176 insertions(+), 91 deletions(-) -- 2.34.1