Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.0/patches/2196703/?format=api
{ "id": 2196703, "url": "http://patchwork.ozlabs.org/api/1.0/patches/2196703/?format=api", "project": { "id": 2, "url": "http://patchwork.ozlabs.org/api/1.0/projects/2/?format=api", "name": "Linux PPC development", "link_name": "linuxppc-dev", "list_id": "linuxppc-dev.lists.ozlabs.org", "list_email": "linuxppc-dev@lists.ozlabs.org", "web_url": "https://github.com/linuxppc/wiki/wiki", "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git", "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/" }, "msgid": "<20260216065639.1750181-4-hbathini@linux.ibm.com>", "date": "2026-02-16T06:56:37", "name": "[3/5] powerpc64/bpf: use consistent tailcall offset in trampoline", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "0ab992f1e913c03348c152e4c82c04c1c1cddda7", "submitter": { "id": 74073, "url": "http://patchwork.ozlabs.org/api/1.0/people/74073/?format=api", "name": "Hari Bathini", "email": "hbathini@linux.ibm.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260216065639.1750181-4-hbathini@linux.ibm.com/mbox/", "series": [ { "id": 492248, "url": "http://patchwork.ozlabs.org/api/1.0/series/492248/?format=api", "date": "2026-02-16T06:56:34", "name": "powerpc64/bpf: various fixes", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/492248/mbox/" } ], "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2196703/checks/", "tags": {}, "headers": { "Return-Path": "\n <linuxppc-dev+bounces-16871-incoming=patchwork.ozlabs.org@lists.ozlabs.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "linuxppc-dev@lists.ozlabs.org" ], "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256\n header.s=pp1 header.b=e57yaJyB;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org\n (client-ip=2404:9400:21b9:f100::1; helo=lists.ozlabs.org;\n envelope-from=linuxppc-dev+bounces-16871-incoming=patchwork.ozlabs.org@lists.ozlabs.org;\n receiver=patchwork.ozlabs.org)", "lists.ozlabs.org;\n arc=none smtp.remote-ip=148.163.156.1", "lists.ozlabs.org;\n dmarc=pass (p=none dis=none) header.from=linux.ibm.com", "lists.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256\n header.s=pp1 header.b=e57yaJyB;\n\tdkim-atps=neutral", "lists.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=linux.ibm.com\n (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com;\n envelope-from=hbathini@linux.ibm.com; receiver=lists.ozlabs.org)" ], "Received": [ "from lists.ozlabs.org (lists.ozlabs.org\n [IPv6:2404:9400:21b9:f100::1])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1 raw public key)\n server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fDtr31XVCz1xpl\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 16 Feb 2026 17:57:23 +1100 (AEDT)", "from boromir.ozlabs.org (localhost [127.0.0.1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4fDtql3D6Mz3bpJ;\n\tMon, 16 Feb 2026 17:57:07 +1100 (AEDT)", "from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com\n [148.163.156.1])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 4fDtqk4fWTz2xlq\n\tfor <linuxppc-dev@lists.ozlabs.org>; Mon, 16 Feb 2026 17:57:06 +1100 (AEDT)", "from pps.filterd (m0353729.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 61FNjKbY3723169;\n\tMon, 16 Feb 2026 06:56:52 GMT", "from ppma12.dal12v.mail.ibm.com\n (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220])\n\tby mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4caj6rpeqs-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n\tMon, 16 Feb 2026 06:56:52 +0000 (GMT)", "from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1])\n\tby ppma12.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id\n 61G6IR3w012624;\n\tMon, 16 Feb 2026 06:56:51 GMT", "from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228])\n\tby ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 4cb3crvg45-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n\tMon, 16 Feb 2026 06:56:51 +0000", "from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com\n [10.20.54.103])\n\tby smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n 61G6ul5L16384328\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);\n\tMon, 16 Feb 2026 06:56:47 GMT", "from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id B70882004D;\n\tMon, 16 Feb 2026 06:56:47 +0000 (GMT)", "from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 0EAD420040;\n\tMon, 16 Feb 2026 06:56:46 +0000 (GMT)", "from li-bd3f974c-2712-11b2-a85c-df1cec4d728e.in.ibm.com (unknown\n [9.78.106.17])\n\tby smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP;\n\tMon, 16 Feb 2026 06:56:45 +0000 (GMT)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1771225027;\n\tcv=none;\n b=b4asOrCMvDCeIyh/inKc+srannwELqPEvarejjRPME0MaFlMYQ/Al68hrxaYMrhgOEoT2RpCJ9sX50bZjtNnBbgCxwRbAD8tMN2W/FlqaU8ifUlzJn6WQAVOroLLV+CwOHLs8Q4RCCf8sdpycPUUcaesNv1lNN/EEBrUg0F4rfiKJuWB6J72N6JBAtTmtoFbSRfjkBxPB2QqM4VDcx0WrVzETuxhFQsf5bfq2aCxuSoSc3PxrV4c7fI4a4pDgaJkRkDkoRRTeU56/X4T69ouGEYGDHb67zrumhYdu6NwvWOyAG7ckFHci4Pufoo48o7K+7PqW8anq2Z2CMWoV2l2MA==", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707;\n\tt=1771225027; c=relaxed/relaxed;\n\tbh=zHk59IxzIIMXT7idlWS8zNdNKadoH3cZhPPcbxmTXJ8=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=Y8SUK8JeI1bTH5nqELV54ukMWn0hFFFF4FKQz5IS0KXc8mz6/P+Plf8ki2iQiFsEisJupPxFJSmgZE2A2bKgayjEbr+0XFOxOFtGrQk1V01cmrIvFB3nCnU1rpthswkH/1nm/L+PBGdF+6ZVXByA/I5FFwECHdueWFSNaYu4CxYvhbbYJRPst6dor6VL/pUDLxHWTqpIsAr4tdAAElwkmOpJ9WlmEWJsJ6Ab++lIyyNO/qNTxE0VwzN01+4qbQMHZpRCvuaD8xgeb3TsNrsdvJJa3wIDpBPdLz09pYQ9pzeZCsQ+TCFahKo0/xBVeGX17Q9rLGAC1ufD4hEq/x+GEg==", "ARC-Authentication-Results": "i=1; lists.ozlabs.org;\n dmarc=pass (p=none dis=none) header.from=linux.ibm.com;\n dkim=pass (2048-bit key;\n unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256\n header.s=pp1 header.b=e57yaJyB; dkim-atps=neutral;\n spf=pass (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com;\n envelope-from=hbathini@linux.ibm.com;\n receiver=lists.ozlabs.org) smtp.mailfrom=linux.ibm.com", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc\n\t:content-transfer-encoding:date:from:in-reply-to:message-id\n\t:mime-version:references:subject:to; s=pp1; bh=zHk59IxzIIMXT7idl\n\tWS8zNdNKadoH3cZhPPcbxmTXJ8=; b=e57yaJyB3yhdpKH7h3FNi8KK11Y5ox0IA\n\tBXsbp7mV1uJXa/p95KdX2BosfsDOu01wks2Gg48Dpt8D29/Ke8ywr94N1dU1EY9W\n\tPRuA+juL+ojxzdUq04+FsQKX/oIJiCZgAZDAKaZDw3wR2VMy9a59FIG7CCdPIanF\n\tYsTy+TGdz0ugrN6ppYaIP4YOFcOQC5MnuewfGFUbsL1diKS5DCyBbTeUTNp1LlvT\n\t73NksMOqkd3MaA46omak4LgfNauxQyqL1V6FE2bTEY4m8iYKSFse4q2u7Wp1NvSM\n\tGdtVzCkZCfyO1jB7kT7ZpxjjPezco4C/35y326Mb+CO1lnZgRiHPA==", "From": "Hari Bathini <hbathini@linux.ibm.com>", "To": "linuxppc-dev <linuxppc-dev@lists.ozlabs.org>", "Cc": "bpf@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,\n Daniel Borkmann <daniel@iogearbox.net>,\n Andrii Nakryiko <andrii@kernel.org>,\n Saket Kumar Bhaskar <skb99@linux.ibm.com>,\n Abhishek Dubey <adubey@linux.ibm.com>", "Subject": "[PATCH 3/5] powerpc64/bpf: use consistent tailcall offset in\n trampoline", "Date": "Mon, 16 Feb 2026 12:26:37 +0530", "Message-ID": "<20260216065639.1750181-4-hbathini@linux.ibm.com>", "X-Mailer": "git-send-email 2.53.0", "In-Reply-To": "<20260216065639.1750181-1-hbathini@linux.ibm.com>", "References": "<20260216065639.1750181-1-hbathini@linux.ibm.com>", "X-Mailing-List": "linuxppc-dev@lists.ozlabs.org", "List-Id": "<linuxppc-dev.lists.ozlabs.org>", "List-Help": "<mailto:linuxppc-dev+help@lists.ozlabs.org>", "List-Owner": "<mailto:linuxppc-dev+owner@lists.ozlabs.org>", "List-Post": "<mailto:linuxppc-dev@lists.ozlabs.org>", "List-Archive": "<https://lore.kernel.org/linuxppc-dev/>,\n <https://lists.ozlabs.org/pipermail/linuxppc-dev/>", "List-Subscribe": "<mailto:linuxppc-dev+subscribe@lists.ozlabs.org>,\n <mailto:linuxppc-dev+subscribe-digest@lists.ozlabs.org>,\n <mailto:linuxppc-dev+subscribe-nomail@lists.ozlabs.org>", "List-Unsubscribe": "<mailto:linuxppc-dev+unsubscribe@lists.ozlabs.org>", "Precedence": "list", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-TM-AS-GCONF": "00", "X-Authority-Analysis": "v=2.4 cv=dvvWylg4 c=1 sm=1 tr=0 ts=6992bfb4 cx=c_pps\n a=bLidbwmWQ0KltjZqbj+ezA==:117 a=bLidbwmWQ0KltjZqbj+ezA==:17\n a=HzLeVaNsDn8A:10 a=VkNPw1HP01LnGYTKEx00:22 a=Mpw57Om8IfrbqaoTuvik:22\n a=GgsMoib0sEa3-_RKJdDe:22 a=VnNF1IyMAAAA:8 a=mg7oJYEXke3Tg0AfzmQA:9", "X-Proofpoint-GUID": "24Fh-U_mTGGgO2DDQET1tFJmMhepSwrD", "X-Proofpoint-ORIG-GUID": "24Fh-U_mTGGgO2DDQET1tFJmMhepSwrD", "X-Proofpoint-Spam-Details-Enc": "AW1haW4tMjYwMjE2MDA1NCBTYWx0ZWRfX93XPhoPbHTfP\n hMDgzf7IJlpRIhPJ9ZDaHrXmvl4GmujnUj5ixEbmJg1+hhRQJg+rejJ1nBuHNpCjF66paUOGOka\n QiYCeencFIL4Wwmlkh9EPUht2QuLe7epozezyrCDTEk1RMyTVFd+J8A0W4wID6Ll1vwkJlBdE6n\n cGcIGT/ZY5ZukVvInJlA1AcvmrbxAziMHVY4dlS96jrpJ5mnz/qDTkHr+jG1MOouLQ3CLgFW1nh\n 5o8EczfMW2AeEvp6C9dHEfW7Ea2VgSB5S9++RuGeBARtfvwvfOd9GPh3cklEnO98VfoNYGfiCqq\n +twx+yeVroIgnAYJ9W62zZTsdT133cAbKGvwDUSf9J2Go/OCOlNx2Hxv5qUIpinmSpOQ3PDaVIs\n 2FgW9URg/x0zNd//kYYpKVTwSRiTyes28wNvhjQE9v7NUEd8cMHSnKANVCCtYghPEsN1FWumBkT\n XLaL56fF0n4L4lga3Vg==", "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49\n definitions=2026-02-16_03,2026-02-13_01,2025-10-01_01", "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n spamscore=0 lowpriorityscore=0 impostorscore=0 adultscore=0\n priorityscore=1501 clxscore=1015 malwarescore=0 phishscore=0 suspectscore=0\n bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound\n adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000\n definitions=main-2602160054", "X-Spam-Status": "No, score=-0.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID,\n\tRCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,\n\tSPF_PASS autolearn=disabled version=4.0.1 OzLabs 8", "X-Spam-Checker-Version": "SpamAssassin 4.0.1 (2024-03-25) on lists.ozlabs.org" }, "content": "Ideally, the offset used to load the tail call info field and to find\nthe pass by reference address for tail call field should be the same.\nBut while setting up the tail call info in the trampoline, this was\nnot followed. This can be misleading and can lead to unpredicable\nresults if and when bpf_has_stack_frame() ends up returning true\nfor trampoline frame. Since commit 15513beeb673 (\"powerpc64/bpf:\nMoving tail_call_cnt to bottom of frame\") and commit 2ed2d8f6fb38\n(\"powerpc64/bpf: Support tailcalls with subprogs\") ensured tail call\nfield is at the bottom of the stack frame for BPF programs as well as\nBPF trampoline, avoid relying on bpf_jit_stack_tailcallinfo_offset()\nand bpf_has_stack_frame() for trampoline frame and always calculate\ntail call field offset with reference to older frame.\n\nFixes: 2ed2d8f6fb38 (\"powerpc64/bpf: Support tailcalls with subprogs\")\nSigned-off-by: Hari Bathini <hbathini@linux.ibm.com>\n---\n arch/powerpc/net/bpf_jit.h | 5 -----\n arch/powerpc/net/bpf_jit_comp.c | 10 ++++------\n arch/powerpc/net/bpf_jit_comp64.c | 5 ++++-\n 3 files changed, 8 insertions(+), 12 deletions(-)", "diff": "diff --git a/arch/powerpc/net/bpf_jit.h b/arch/powerpc/net/bpf_jit.h\nindex 82bbf63f0e57..7354e1d72f79 100644\n--- a/arch/powerpc/net/bpf_jit.h\n+++ b/arch/powerpc/net/bpf_jit.h\n@@ -81,9 +81,6 @@\n \n #ifdef CONFIG_PPC64\n \n-/* for gpr non volatile registers BPG_REG_6 to 10 */\n-#define BPF_PPC_STACK_SAVE\t(6 * 8)\n-\n /* If dummy pass (!image), account for maximum possible instructions */\n #define PPC_LI64(d, i)\t\tdo {\t\t\t\t\t \\\n \tif (!image)\t\t\t\t\t\t\t \\\n@@ -219,8 +216,6 @@ int bpf_jit_emit_exit_insn(u32 *image, struct codegen_context *ctx, int tmp_reg,\n int bpf_add_extable_entry(struct bpf_prog *fp, u32 *image, u32 *fimage, int pass,\n \t\t\t struct codegen_context *ctx, int insn_idx,\n \t\t\t int jmp_off, int dst_reg, u32 code);\n-\n-int bpf_jit_stack_tailcallinfo_offset(struct codegen_context *ctx);\n #endif\n \n #endif\ndiff --git a/arch/powerpc/net/bpf_jit_comp.c b/arch/powerpc/net/bpf_jit_comp.c\nindex fb6cc1f832a8..1ff8030faf1f 100644\n--- a/arch/powerpc/net/bpf_jit_comp.c\n+++ b/arch/powerpc/net/bpf_jit_comp.c\n@@ -642,15 +642,13 @@ static void bpf_trampoline_setup_tail_call_info(u32 *image, struct codegen_conte\n \t\t\t\t\t\tint bpf_dummy_frame_size, int r4_off)\n {\n \tif (IS_ENABLED(CONFIG_PPC64)) {\n-\t\t/* See Generated stack layout */\n-\t\tint tailcallinfo_offset = BPF_PPC_TAILCALL;\n-\n \t\t/*\n \t\t * func_frame_offset = ...(1)\n \t\t * bpf_dummy_frame_size + trampoline_frame_size\n \t\t */\n \t\tEMIT(PPC_RAW_LD(_R4, _R1, func_frame_offset));\n-\t\tEMIT(PPC_RAW_LD(_R3, _R4, -tailcallinfo_offset));\n+\t\t/* Refer to trampoline's Generated stack layout */\n+\t\tEMIT(PPC_RAW_LD(_R3, _R4, -BPF_PPC_TAILCALL));\n \n \t\t/*\n \t\t * Setting the tail_call_info in trampoline's frame\n@@ -658,7 +656,7 @@ static void bpf_trampoline_setup_tail_call_info(u32 *image, struct codegen_conte\n \t\t */\n \t\tEMIT(PPC_RAW_CMPLWI(_R3, MAX_TAIL_CALL_CNT));\n \t\tPPC_BCC_CONST_SHORT(COND_GT, 8);\n-\t\tEMIT(PPC_RAW_ADDI(_R3, _R4, bpf_jit_stack_tailcallinfo_offset(ctx)));\n+\t\tEMIT(PPC_RAW_ADDI(_R3, _R4, -BPF_PPC_TAILCALL));\n \t\t/*\n \t\t * From ...(1) above:\n \t\t * trampoline_frame_bottom = ...(2)\n@@ -673,7 +671,7 @@ static void bpf_trampoline_setup_tail_call_info(u32 *image, struct codegen_conte\n \t\t * tail_call_info in trampoline frame.\n \t\t */\n \t\tEMIT(PPC_RAW_STL(_R3, _R1, (func_frame_offset - bpf_dummy_frame_size)\n-\t\t\t\t\t\t\t\t- tailcallinfo_offset));\n+\t\t\t\t\t\t\t\t- BPF_PPC_TAILCALL));\n \t} else {\n \t\t/* See bpf_jit_stack_offsetof() and BPF_PPC_TC */\n \t\tEMIT(PPC_RAW_LL(_R4, _R1, r4_off));\ndiff --git a/arch/powerpc/net/bpf_jit_comp64.c b/arch/powerpc/net/bpf_jit_comp64.c\nindex 44ce8a8783f9..5d4d2bb23cef 100644\n--- a/arch/powerpc/net/bpf_jit_comp64.c\n+++ b/arch/powerpc/net/bpf_jit_comp64.c\n@@ -42,6 +42,9 @@\n * exception boundary.\n */\n \n+/* BPF non-volatile registers save area size */\n+#define BPF_PPC_STACK_SAVE\t(6*8)\n+\n /* for bpf JIT code internal usage */\n #define BPF_PPC_STACK_LOCALS\t24\n /*\n@@ -148,7 +151,7 @@ static int bpf_jit_stack_local(struct codegen_context *ctx)\n \t}\n }\n \n-int bpf_jit_stack_tailcallinfo_offset(struct codegen_context *ctx)\n+static int bpf_jit_stack_tailcallinfo_offset(struct codegen_context *ctx)\n {\n \treturn bpf_jit_stack_local(ctx) + BPF_PPC_STACK_LOCALS + BPF_PPC_STACK_SAVE;\n }\n", "prefixes": [ "3/5" ] }