From patchwork Mon Nov 4 05:00:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saket Kumar Bhaskar X-Patchwork-Id: 841915 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 84918167296; Mon, 4 Nov 2024 05:01:00 +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=1730696462; cv=none; b=MVHH6sKzgPiVoEwq1ARyAYrgEGd0qkgcVdqynJJbARQsDBsum/nBrT99GjK0fOD0WmGpiRkT2PJw/d5IynPpdrwJZxr5lk7YIhRdzAXsJGMTUMw/u+vzxTGtJsQriOEn3x3WilfVphfFs6l7L4Xv+ywLuqOY1vsMwWLbjwDTfK4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730696462; c=relaxed/simple; bh=ktDAHwazGWY+plW4eh0jRusrcAntuwF/4zFZNHFXc/I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hG6bEhKqBVL4fFDW0JL3wNHVsL6LEdPhMQAGcDuUouds625LUhc2QKCHaYG1zNbL116w565hgqKR5aqKzrwwj/MnFZ/W9ZJqIiOwgKP/qSnobU5woV6pXSOlzgHLCFLl7qY3E6TR/znoxkHytqOOZeCCBQZZIVc13ORfajth4Fc= 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=m25UMVyy; 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="m25UMVyy" Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4A44E01u019687; Mon, 4 Nov 2024 05:00:37 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=waXRDhrP74pyp3e+J NR0YrviqCskMEuMN4GhuoSU9zk=; b=m25UMVyy/qUNB3Ervmk1gGEJ8CZpE0kwu 6ld17XagCkScvcqCeHThV4mDoFyZRRPAmDYyeBQIkNAPUDoXqHxsZidk1p0dUmmH dL33WjNLRuv1GcGg0qwTA8xXvj0A6lOfhcqPrHMDzIdyOsP+z0WudQWVbl0phlZw btb/0E4ineJ2ERE1mLL+ARSuLTgn0Uc/3tecINHO6Ihtqb5JGKFV8GnQjQq6M+RB Tau5mUYuVYA1rdCCdEhD2x3Gp2jlJF/ihssQheH+v9UZHZI1SOydOfC3mIlp6dOp 5+M6sQHuE962ROx5HJvdWbWfBqS3Q30WlkZq1l3SkJhPWRp0GULMg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 42pjku8mxm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 04 Nov 2024 05:00:37 +0000 (GMT) Received: from m0360083.ppops.net (m0360083.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4A44wiuN003330; Mon, 4 Nov 2024 05:00:36 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 42pjku8mxh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 04 Nov 2024 05:00:36 +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 4A43gYa9024261; Mon, 4 Nov 2024 05:00:34 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 42nxsxt2hj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 04 Nov 2024 05:00:34 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4A450VWc27132622 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 4 Nov 2024 05:00:32 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6B1932004F; Mon, 4 Nov 2024 05:00:31 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 62B7020040; Mon, 4 Nov 2024 05:00:23 +0000 (GMT) Received: from li-621bac4c-27c7-11b2-a85c-c2bf7c4b3c07.ibm.com.com (unknown [9.43.56.204]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 4 Nov 2024 05:00:22 +0000 (GMT) From: Saket Kumar Bhaskar To: bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: ast@kernel.org, hbathini@linux.ibm.com, andrii@kernel.org, daniel@iogearbox.net, martin.lau@linux.dev, eddyz87@gmail.com, song@kernel.org, yonghong.song@linux.dev, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@fomichev.me, haoluo@google.com, jolsa@kernel.org, shuah@kernel.org, mykolal@fb.com Subject: [PATCH 1/3] libbpf: Fix accessing the syscall argument on powerpc Date: Mon, 4 Nov 2024 10:30:05 +0530 Message-ID: <20241104050007.13812-2-skb99@linux.ibm.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241104050007.13812-1-skb99@linux.ibm.com> References: <20241104050007.13812-1-skb99@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: Fmgv3EWaqAv_zeu_UpHKqDmCVKtwyRI5 X-Proofpoint-ORIG-GUID: IuVlMS63keH3rEBA_qLKbXpo26Nc3OXw X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-15_01,2024-10-11_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 lowpriorityscore=0 clxscore=1015 impostorscore=0 mlxlogscore=810 mlxscore=0 bulkscore=0 malwarescore=0 priorityscore=1501 phishscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2411040039 Since commit 7e92e01b7245 ("powerpc: Provide syscall wrapper"), powerpc selects ARCH_HAS_SYSCALL_WRAPPER so let's use the generic implementation of PT_REGS_SYSCALL_REGS(). Also, allow overriding PT_REGS_PARM1{_CORE}_SYSCALL for powerpc as powerpc needs orig_gpr3, similar to s390 and arm64. Signed-off-by: Saket Kumar Bhaskar --- tools/lib/bpf/bpf_tracing.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/lib/bpf/bpf_tracing.h b/tools/lib/bpf/bpf_tracing.h index a8f6cd4841b0..933e1dab6c8f 100644 --- a/tools/lib/bpf/bpf_tracing.h +++ b/tools/lib/bpf/bpf_tracing.h @@ -287,6 +287,10 @@ struct pt_regs___arm64 { * section "Function Calling Sequence") */ +struct pt_regs___powerpc { + unsigned long orig_gpr3; +} __attribute__((preserve_access_index)); + #define __PT_PARM1_REG gpr[3] #define __PT_PARM2_REG gpr[4] #define __PT_PARM3_REG gpr[5] @@ -296,8 +300,6 @@ struct pt_regs___arm64 { #define __PT_PARM7_REG gpr[9] #define __PT_PARM8_REG gpr[10] -/* powerpc does not select ARCH_HAS_SYSCALL_WRAPPER. */ -#define PT_REGS_SYSCALL_REGS(ctx) ctx #define __PT_PARM1_SYSCALL_REG orig_gpr3 #define __PT_PARM2_SYSCALL_REG __PT_PARM2_REG #define __PT_PARM3_SYSCALL_REG __PT_PARM3_REG @@ -307,6 +309,9 @@ struct pt_regs___arm64 { #if !defined(__arch64__) #define __PT_PARM7_SYSCALL_REG __PT_PARM7_REG /* only powerpc (not powerpc64) */ #endif +#define PT_REGS_PARM1_SYSCALL(x) (((const struct pt_regs___powerpc *)(x))->orig_gpr3) +#define PT_REGS_PARM1_CORE_SYSCALL(x) \ + BPF_CORE_READ((const struct pt_regs___powerpc *)(x), __PT_PARM1_SYSCALL_REG) #define __PT_RET_REG regs[31] #define __PT_FP_REG __unsupported__ From patchwork Mon Nov 4 05:00:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saket Kumar Bhaskar X-Patchwork-Id: 840667 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 33A8C10F1; Mon, 4 Nov 2024 05:00:58 +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=1730696460; cv=none; b=e3j4awykzEGjwfeEiTATOewtTIoANKJwI8AD3bdxtq8oHiKq45jqmsb5xvXfKbW6fmEo12Ee7+xjyd1BgkrjHnEiFpLjhOJJ8pkETTVeFu2JkFH/ivzA9gzzbio62fPQo3DEEl/cfS3DEGOBRPzx/CVYLSLvLWsjqwOLTomCayU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730696460; c=relaxed/simple; bh=Rm82q0ZknfUmj4kwcWzzFUkJM8pgl/vkFS6bUCrEUQ4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rapgRLU29BLs7qxegOUxQfFrxyeLJpP5O7uL42ElrzL6NNDBKrnFoByWOSgNJMNRKLR+pPir+La5+uP2ilDKEY2HxbE2YqBCANDi+rCS7qTxS1LnkE3lFOF/NtL14KHiAWziGlyBfF1ihZ+lf6dQyXGFz3jkI1qgoY18cCLs3E8= 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=G4c4zK2s; 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="G4c4zK2s" Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4A44E01v019687; Mon, 4 Nov 2024 05:00:43 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=e70GGPQYM1V4LtEUN OoedzvOzqQVu1Uij7dITb52iSY=; b=G4c4zK2sKMhI+BnKpH8F+9FJpuofLwJy0 EXgkiuzFsKBdRZO+ermeTo6GTX+eEm4bJ4HgNgPN1pC6LUd8fksGK6WC8OVs94OR TtbFqEhmWOOWcAZwkIUddVKxS2qhMqoF2TxL338/nb7v1Cf8AVHNfsIklDE8kaUN GIavd0uj/hBJLx5y4aUmcovIYR267YtNOtAKWaJFK6L4n1wBQJdbuzn2FGyLBkgL yH9nfZp4qSkuqtUe58tMfdV+Re5JZsc1RY0RPKTDv4UPl0N46FVRHqDVix4zI1fj 4zadDHnpT/C7SVsEDF1bqsKi5poUOrGxU8yQ/0J/I/K/BlczGFx6A== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 42pjku8my1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 04 Nov 2024 05:00:43 +0000 (GMT) Received: from m0360083.ppops.net (m0360083.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4A450g8b006135; Mon, 4 Nov 2024 05:00:42 GMT Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 42pjku8mxw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 04 Nov 2024 05:00:42 +0000 (GMT) Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 4A3GYXKY024243; Mon, 4 Nov 2024 05:00:41 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 42nxds1j2w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 04 Nov 2024 05:00:41 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4A450evS34079428 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 4 Nov 2024 05:00:40 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F267920049; Mon, 4 Nov 2024 05:00:39 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 31E1A2004B; Mon, 4 Nov 2024 05:00:32 +0000 (GMT) Received: from li-621bac4c-27c7-11b2-a85c-c2bf7c4b3c07.ibm.com.com (unknown [9.43.56.204]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 4 Nov 2024 05:00:31 +0000 (GMT) From: Saket Kumar Bhaskar To: bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: ast@kernel.org, hbathini@linux.ibm.com, andrii@kernel.org, daniel@iogearbox.net, martin.lau@linux.dev, eddyz87@gmail.com, song@kernel.org, yonghong.song@linux.dev, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@fomichev.me, haoluo@google.com, jolsa@kernel.org, shuah@kernel.org, mykolal@fb.com Subject: [PATCH 2/3] libbpf: Remove powerpc prefix from syscall function names Date: Mon, 4 Nov 2024 10:30:06 +0530 Message-ID: <20241104050007.13812-3-skb99@linux.ibm.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241104050007.13812-1-skb99@linux.ibm.com> References: <20241104050007.13812-1-skb99@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: gHA9h9E6M1FDMEIDMwKuHaHDW1mQsKkB X-Proofpoint-ORIG-GUID: nsJVGQHgJ0gwUPAZh_NGiCTYcTJeaz35 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-15_01,2024-10-11_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 lowpriorityscore=0 clxscore=1015 impostorscore=0 mlxlogscore=806 mlxscore=0 bulkscore=0 malwarescore=0 priorityscore=1501 phishscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2411040039 Since commit 94746890202cf ("powerpc: Don't add __powerpc_ prefix to syscall entry points") drops _powerpc prefix to syscall entry points, even though powerpc now supports syscall wrapper, so /proc/kallsyms have symbols for syscall entry without powerpc prefix(sys_*). For this reason, arch specific prefix for syscall functions in powerpc is dropped. Signed-off-by: Saket Kumar Bhaskar --- tools/lib/bpf/libbpf.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index 219facd0e66e..3a370fa37d8a 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -11110,9 +11110,7 @@ static const char *arch_specific_syscall_pfx(void) #elif defined(__riscv) return "riscv"; #elif defined(__powerpc__) - return "powerpc"; -#elif defined(__powerpc64__) - return "powerpc64"; + return ""; #else return NULL; #endif @@ -11127,7 +11125,11 @@ int probe_kern_syscall_wrapper(int token_fd) if (!ksys_pfx) return 0; +#if defined(__powerpc__) + snprintf(syscall_name, sizeof(syscall_name), "sys_bpf"); +#else snprintf(syscall_name, sizeof(syscall_name), "__%s_sys_bpf", ksys_pfx); +#endif if (determine_kprobe_perf_type() >= 0) { int pfd; @@ -11272,8 +11274,12 @@ struct bpf_link *bpf_program__attach_ksyscall(const struct bpf_program *prog, * compiler does not know that we have an explicit conditional * as well. */ +#if defined(__powerpc__) + snprintf(func_name, sizeof(func_name), "sys_%s", syscall_name); +#else snprintf(func_name, sizeof(func_name), "__%s_sys_%s", arch_specific_syscall_pfx() ? : "", syscall_name); +#endif } else { snprintf(func_name, sizeof(func_name), "__se_sys_%s", syscall_name); } From patchwork Mon Nov 4 05:00:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saket Kumar Bhaskar X-Patchwork-Id: 840666 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 EC2C9176FD2; Mon, 4 Nov 2024 05:01:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730696477; cv=none; b=VKAFuCV8Nl0HldSZrw/P4q3lg6MJ5e66FBUlbngrQoyWClTfqp2e6eYtioo00EheU7/iOAmlY8IRLDr3Ug9fEcek78ghgSUfw9QmvOzRyOPe6PZN/PaG50JWnlHio3aRl3I0YU+gLZTbLnVemDnIsav2kZEeU5FlQMHcs+TtKRY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730696477; c=relaxed/simple; bh=eNk1qrWiIpqyQruMIXPEsp0Zl9FdbV4nynjf+0NTCLg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nrKgtHGpcOS/mYMnyGT9o9wKSIQbu932EPztMxZZQ6mURacOWqtMwkk3DR/v7dV5bc/1u73NFuQORCuqp4eAOpF/hcl7yMsroIxmkAdqEyiJQEb845NB5sFV/2GLV1Bvv7+oZrrrsYgoTglvWiP1EYms9CKiGAdEO4ykoQW4YhM= 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=RtNDSqr/; arc=none smtp.client-ip=148.163.158.5 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="RtNDSqr/" Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4A44CB5N010647; Mon, 4 Nov 2024 05:00:52 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=D8Pdin9KD/HZgOJgF RoUxc38HRKm5PW4gSCHApqk8To=; b=RtNDSqr/1+scKOCjmmF7aSgzW3w8+6y4Y nO1GX9O0H5lbk7vcjXpKUY2ZBvVejbNV8Z7ifjCI95BgsqeBPVmk0cYWZKl+Rep9 RWZ3Y+/qSQmQOTpfojZPh1wNXdSQQp1rAa2zYiCDeIlnpdWwLtAgnre46mwER+tt 4Ic+BiZSuyqKNLUdLDWDz7Xiqv3822NZn/2R0i27tJAldOlRLsYjcC2qjW6e4RKW IpzfrEK11LpjKZImYF3Zuvp9Kv6W3ki8GvTLKW37FDIhtphmKXLxSlRSJl8UVdXO MqeNSxBjF+2DcjVucVr6V9rmLvx1KNUprwMycEREvTuBmE7ssIYTw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 42pq1802rt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 04 Nov 2024 05:00:52 +0000 (GMT) Received: from m0360072.ppops.net (m0360072.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4A44vPut026739; Mon, 4 Nov 2024 05:00:51 GMT Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 42pq1802rr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 04 Nov 2024 05:00:51 +0000 (GMT) Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 4A3HaJWw031980; Mon, 4 Nov 2024 05:00:50 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 42nydmhfwt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 04 Nov 2024 05:00:50 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4A450mx444171656 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 4 Nov 2024 05:00:48 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A6C4E20049; Mon, 4 Nov 2024 05:00:48 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B8A3C20040; Mon, 4 Nov 2024 05:00:40 +0000 (GMT) Received: from li-621bac4c-27c7-11b2-a85c-c2bf7c4b3c07.ibm.com.com (unknown [9.43.56.204]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 4 Nov 2024 05:00:40 +0000 (GMT) From: Saket Kumar Bhaskar To: bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: ast@kernel.org, hbathini@linux.ibm.com, andrii@kernel.org, daniel@iogearbox.net, martin.lau@linux.dev, eddyz87@gmail.com, song@kernel.org, yonghong.song@linux.dev, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@fomichev.me, haoluo@google.com, jolsa@kernel.org, shuah@kernel.org, mykolal@fb.com Subject: [PATCH 3/3] selftests/bpf: Define SYS_PREFIX for powerpc Date: Mon, 4 Nov 2024 10:30:07 +0530 Message-ID: <20241104050007.13812-4-skb99@linux.ibm.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241104050007.13812-1-skb99@linux.ibm.com> References: <20241104050007.13812-1-skb99@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 1GqNEolRUvHbgFwfZATml1biJkH79Wx5 X-Proofpoint-ORIG-GUID: K3AwoyN1KAqLUxWn-02SYeT0C1tgoaV0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-15_01,2024-10-11_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 phishscore=0 impostorscore=0 mlxscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 spamscore=0 mlxlogscore=641 clxscore=1015 priorityscore=1501 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2411040039 SYS_PREFIX was missing for a powerpc, which made a kprobe test to sys_prctl fail. Add missing SYS_PREFIX for powerpc. Fixes: 7e92e01b7245 ("powerpc: Provide syscall wrapper") Fixes: 94746890202c ("powerpc: Don't add __powerpc_ prefix to syscall entry points") Signed-off-by: Saket Kumar Bhaskar --- tools/testing/selftests/bpf/progs/bpf_misc.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/testing/selftests/bpf/progs/bpf_misc.h b/tools/testing/selftests/bpf/progs/bpf_misc.h index eccaf955e394..ae6beb2fb480 100644 --- a/tools/testing/selftests/bpf/progs/bpf_misc.h +++ b/tools/testing/selftests/bpf/progs/bpf_misc.h @@ -160,6 +160,9 @@ #elif defined(__TARGET_ARCH_riscv) #define SYSCALL_WRAPPER 1 #define SYS_PREFIX "__riscv_" +#elif defined(__TARGET_ARCH_powerpc) +#define SYSCALL_WRAPPER 1 +#define SYS_PREFIX "" #else #define SYSCALL_WRAPPER 0 #define SYS_PREFIX "__se_"