From nobody Sun Feb 8 21:33:53 2026 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 A1E6634B1B6; Thu, 22 Jan 2026 21:21:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769116882; cv=none; b=UpXZNDuj8RNMtgZ/I8HmrNzPFqZfdJ56Bv6pyYGvuwWe1gL+3ji3YL2iL2U3htb8Hkda34yGlI/3b1HBo+oZT2LIinXgzi3j6EU/QUixWc2IoDOFujaI4u5Wlp2DHymYGP2UEmodO1dnRIL2JMZk4hvdHFeKw0XrKJGMT6dnKrU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769116882; c=relaxed/simple; bh=okLPwzpehcD1gB91punSYSgMEs8dxU5bAyjroI+uESg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nMHPZIgbHLYHGW2n8rEAFQCHSKNivBUE5RxdvrxBJ8h2vDaaqmcOnfSMgim31xlsRRmwqdeqVgZBkI6jSApqD3pYv/ZWtjJQ92n2JxtQBrMCWBbyCAeAaTm15A038boCcmzObdUQrtDL+4NnjS1FK0JvDj315GR+ZgyGNhZHZLQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=g7HXFva3; arc=none smtp.client-ip=148.163.156.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="g7HXFva3" Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 60MD86fQ006766; Thu, 22 Jan 2026 21:19:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=15+B6CbLt2ChyR8qt ylg18EYlouONEheH96W2YTGceI=; b=g7HXFva3akx2SufG19+76Q1rZ1c9r8ax0 VvRQVmfcFNgF7HHenYskfuvnCQ3wqHYF7vf9wYFHfAI+cd9yC60JWg93o6onQ7YD TJ61mMCYm2sNEPIH6gftldH/oLlsfP8oWX5s6qgjvjd1e7LLt2PGLeJKzvz97r1n wnODdVbpEyZI5YreAOvxNV2Bl8SYHnCIYpP99tPa9tjaRCjjWPi8NC8fhjulSA/p q5Nkro9tnYhY7lctId4q38iQaA9K3tJbUVCjuTPr5F5n96MWJmo3tNeoVzevmQr9 N/MEpcrBjgVpADjMOS/l9OITXRJcd9kNfiHw62QUCAJIIhc/kP+Ig== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4br23sc90w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Jan 2026 21:19:50 +0000 (GMT) Received: from m0353729.ppops.net (m0353729.ppops.net [127.0.0.1]) by pps.reinject (8.18.1.12/8.18.0.8) with ESMTP id 60MLJn9Y018809; Thu, 22 Jan 2026 21:19:49 GMT Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4br23sc90u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Jan 2026 21:19:49 +0000 (GMT) Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 60MKKfuU016611; Thu, 22 Jan 2026 21:19:48 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4brn4yd3v9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Jan 2026 21:19:47 +0000 Received: from smtpav03.fra02v.mail.ibm.com (smtpav03.fra02v.mail.ibm.com [10.20.54.102]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 60MLJh7745744428 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Jan 2026 21:19:43 GMT Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C03E32004B; Thu, 22 Jan 2026 21:19:43 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6508420040; Thu, 22 Jan 2026 21:19:37 +0000 (GMT) Received: from abhi.. (unknown [9.124.222.159]) by smtpav03.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 22 Jan 2026 21:19:37 +0000 (GMT) From: adubey@linux.ibm.com To: bpf@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: hbathini@linux.ibm.com, sachinpb@linux.ibm.com, venkat88@linux.ibm.com, andrii@kernel.org, eddyz87@gmail.com, mykolal@fb.com, ast@kernel.org, daniel@iogearbox.net, martin.lau@linux.dev, song@kernel.org, yonghong.song@linux.dev, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@fomichev.me, haoluo@google.com, jolsa@kernel.org, christophe.leroy@csgroup.eu, naveen@kernel.org, maddy@linux.ibm.com, mpe@ellerman.id.au, npiggin@gmail.com, memxor@gmail.com, iii@linux.ibm.com, shuah@kernel.org Subject: [PATCH v4 3/6] powerpc64/bpf: Avoid tailcall restore from trampoline Date: Fri, 23 Jan 2026 02:48:51 +0530 Message-ID: <20260122211854.5508-4-adubey@linux.ibm.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20260122211854.5508-1-adubey@linux.ibm.com> References: <20260122211854.5508-1-adubey@linux.ibm.com> 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-TM-AS-GCONF: 00 X-Proofpoint-GUID: GPwLLMBfru7JZbASjB3ZK79lwNgowuaC X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTIyMDE2MiBTYWx0ZWRfX7jrp/6j5IKgq nkjEL6fWOb1cwK6VUJk2BEww/LuWV96XbkNN0i7ejG0M/GhsC9E+NsBaKloHr/sRiJGEVQZQA/V qqrWeKhE9ZWOefMjeOYb/tzRHNtGOmpj0bEnsmJW1cC/ITFSi4+i9/AipNsVBvxOi08x5EzjUbK +kG4NCcELPN9S1dfqNNCRC/eykiqaVxlqGRFbpxC+SXgul13RYro8Pa82bsi07EbdnLX/yathMd lC2GtEjPCcem9jhIKe6iGU4epwgA8Pg1zLft6jOc/kw2JrlzxvG09EQPU9XMKdD1C+gZTQrulrZ uFAafwsOlpp0Yss+TlsjXT0bnauFpYWDtW3Plh4UmzOjwIMPkQlAyvwz/dX43onoaVE8rn7yqG3 9V1PIE9I5A61UAiq22tRRW4BX62u+/DxPlqenqxeayhza7bTRg5miXwbmPo9s4jUjlFZMnTAbIC WaxSpc8101QXgN1Q+Pw== X-Authority-Analysis: v=2.4 cv=J9SnLQnS c=1 sm=1 tr=0 ts=69729476 cx=c_pps a=5BHTudwdYE3Te8bg5FgnPg==:117 a=5BHTudwdYE3Te8bg5FgnPg==:17 a=vUbySO9Y5rIA:10 a=VkNPw1HP01LnGYTKEx00:22 a=VnNF1IyMAAAA:8 a=yUNxoNuUyiXgUDPvJtcA:9 X-Proofpoint-ORIG-GUID: qfme069ZT8EvMbnwutMdsEnYi-f7akUY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.20,FMLib:17.12.100.49 definitions=2026-01-22_05,2026-01-22_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 adultscore=0 suspectscore=0 spamscore=0 lowpriorityscore=0 malwarescore=0 clxscore=1015 bulkscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2601150000 definitions=main-2601220162 Content-Type: text/plain; charset="utf-8" From: Abhishek Dubey Back propagation of tailcall count is no longer needed for powerpc64 due to use of reference, which updates the tailcall count in the tail_call_info field in the frame of the main program only. Back propagation is still required for 32-bit powerpc. Signed-off-by: Abhishek Dubey --- arch/powerpc/net/bpf_jit_comp.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/net/bpf_jit_comp.c b/arch/powerpc/net/bpf_jit_com= p.c index 93355ba5382a..1a305f0fed27 100644 --- a/arch/powerpc/net/bpf_jit_comp.c +++ b/arch/powerpc/net/bpf_jit_comp.c @@ -662,14 +662,11 @@ static void bpf_trampoline_setup_tail_call_info(u32 *= image, struct codegen_conte static void bpf_trampoline_restore_tail_call_cnt(u32 *image, struct codege= n_context *ctx, int func_frame_offset, int r4_off) { - if (IS_ENABLED(CONFIG_PPC64)) { - /* See bpf_jit_stack_tailcallcnt() */ - int tailcallcnt_offset =3D BPF_PPC_TAILCALL; - - EMIT(PPC_RAW_LL(_R3, _R1, -tailcallcnt_offset)); - EMIT(PPC_RAW_STL(_R3, _R1, func_frame_offset - tailcallcnt_offset)); - } else { - /* See bpf_jit_stack_offsetof() and BPF_PPC_TC */ + if (IS_ENABLED(CONFIG_PPC32)) { + /* + * Restore tailcall for 32-bit powerpc + * See bpf_jit_stack_offsetof() and BPF_PPC_TC + */ EMIT(PPC_RAW_STL(_R4, _R1, r4_off)); } } --=20 2.48.1