From patchwork Mon Dec 9 15:14:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Madhavan Srinivasan X-Patchwork-Id: 848531 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 BA8FD233133 for ; Mon, 9 Dec 2024 15:14:43 +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=1733757285; cv=none; b=WdRUV/NijWbUyg4C41UBEu8mXFj3YFN632d7qKFbp9jpK/id3LueIX/YKdzibaeinvLdyOTDbE1+6yAHrWrb+3TRV8DwM0y9AFaeAQbkuMr3oXsRvgttYxrwzxkW9AH/6y6P5vHWB7ZTAMD7GOxb5CoPN16eNmyJuyKRZ/5Sjv0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733757285; c=relaxed/simple; bh=AxP0ZoQquoHpdN1DjX4Jn/8NqUN81Dn0TMd87V8aTSI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=BCC16AJumLh/ClU9K42D9fiwfoEW5Y8Q08l923m49XUfJx03gLOZYucVWUs3LFvxly76cH9j9f048zJpyzqBqKRpqcN7BzJiMYh0HVjL2FSi6OpW10uFaZGTjc0Ap8gMpz6lwCKHIuw8xu9TcBXBB0nzYqwptVhfOBeAaxUFIQo= 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=C99Js8t5; 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="C99Js8t5" 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 4B99tMFo012694; Mon, 9 Dec 2024 15:14:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:message-id:mime-version :subject:to; s=pp1; bh=LmIRy0hQyWfVQsj22M6r9H2LJI7thfpO4bx0jVaDu TA=; b=C99Js8t5ly1KfohB6u0/aTVf6G4e67ItnWttkqvwKwDhjYGS5oGHwwrCq KvoUHVMRprxRQ/HbovHlT7SvnUsnpC3q2r2LjeiOANP8MNJX93nXgIS776SW1KL+ nc6+8qlSm5/ZnAHFJHdj4hD2RkWShx27UaEaCa2bLoi718bODgx4+ahnw6vfcdQR cyCO+6YTUEK03vbUyJTOFz2hUDeKRIzb170lwWs4wKUsfWk3oDb4tStA765r9mny izD3lgEdAwaZQAj6Wn3b519bTOYbeysFE/3UkO744hJEQZ4JE4oL8bO+zSPOBhGG JrFVvU0CacjBPv3iDjtC5P/94ThUg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 43ce1vj19p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 09 Dec 2024 15:14:27 +0000 (GMT) Received: from m0353729.ppops.net (m0353729.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4B9F4wsw029873; Mon, 9 Dec 2024 15:14:27 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 43ce1vj19j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 09 Dec 2024 15:14:27 +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 4B9DUd6L032739; Mon, 9 Dec 2024 15:14:26 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 43d0ps7def-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 09 Dec 2024 15:14:26 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4B9FEORE48431580 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 9 Dec 2024 15:14:24 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BA4532004E; Mon, 9 Dec 2024 15:14:24 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9B54220043; Mon, 9 Dec 2024 15:14:22 +0000 (GMT) Received: from li-c439904c-24ed-11b2-a85c-b284a6847472.ibm.com.com (unknown [9.43.38.185]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 9 Dec 2024 15:14:22 +0000 (GMT) From: Madhavan Srinivasan To: mpe@ellerman.id.au, npiggin@gmail.com, christophe.leroy@csgroup.eu, naveen@kernel.org, shuah@kernel.org Cc: linuxppc-dev@lists.ozlabs.org, linux-kselftest@vger.kernel.org, Madhavan Srinivasan Subject: [PATCH 1/3] selftest/powerpc/ptrace/core-pkey: Remove duplicate macros Date: Mon, 9 Dec 2024 20:44:16 +0530 Message-ID: <20241209151418.348085-1-maddy@linux.ibm.com> X-Mailer: git-send-email 2.47.0 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: ZI2SEWgTG1VJinRbLkvfTq-3MbHG4YEl X-Proofpoint-ORIG-GUID: m5Cn0xHP-2LDINIu4JG_4tN8upeXt_5g 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 lowpriorityscore=0 priorityscore=1501 clxscore=1011 phishscore=0 bulkscore=0 mlxlogscore=969 impostorscore=0 spamscore=0 malwarescore=0 suspectscore=0 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412090117 core-pkey.c test has couple of macros defined which are part of "pkeys.h" header file. Remove those duplicates and include "pkeys.h" Signed-off-by: Madhavan Srinivasan --- .../selftests/powerpc/ptrace/core-pkey.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/tools/testing/selftests/powerpc/ptrace/core-pkey.c b/tools/testing/selftests/powerpc/ptrace/core-pkey.c index f6da4cb30cd6..31c9bf6d95db 100644 --- a/tools/testing/selftests/powerpc/ptrace/core-pkey.c +++ b/tools/testing/selftests/powerpc/ptrace/core-pkey.c @@ -16,14 +16,7 @@ #include #include "ptrace.h" #include "child.h" - -#ifndef __NR_pkey_alloc -#define __NR_pkey_alloc 384 -#endif - -#ifndef __NR_pkey_free -#define __NR_pkey_free 385 -#endif +#include "pkeys.h" #ifndef NT_PPC_PKEY #define NT_PPC_PKEY 0x110 @@ -61,16 +54,6 @@ struct shared_info { time_t core_time; }; -static int sys_pkey_alloc(unsigned long flags, unsigned long init_access_rights) -{ - return syscall(__NR_pkey_alloc, flags, init_access_rights); -} - -static int sys_pkey_free(int pkey) -{ - return syscall(__NR_pkey_free, pkey); -} - static int increase_core_file_limit(void) { struct rlimit rlim; From patchwork Mon Dec 9 15:14:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Madhavan Srinivasan X-Patchwork-Id: 849524 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 BD4F2233133 for ; Mon, 9 Dec 2024 15:14:49 +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=1733757291; cv=none; b=UUYQ7qdyUnZhZd6OJR6jo9FQ/FDRjEiaiiNdmOIYg4uYCe8WQYp8FQufBPFPHz4bCNXosrjn+qAFGwpOW9INFlepuuRYp1PIJN3brH790wIKzy1Yt5CmtpACDop1yjXo5ZGZBn+MBjU5clp2O2wVsTcOJCaFI/7tF/m5In4uBds= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733757291; c=relaxed/simple; bh=SD+3D/wKkQoadRyru3KOAHIsyFroSyAUfI1+LxydrcA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Dd6srm4LiaRjqFptVAiDpo1KX3NYU9rr7MYT6qLNgN+gY7EeWdmDl5D05IFFMkBF/fccJoZoTwN8N43fSGiCmjr1uAgLChWxoTwR9TGLnTqWTaDELtpnFTrOwR9q0cl6ihFFWUEEiYX7YfHfxLjyVyjV6JxrnrnvwLyPKPpxYLg= 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=ERsbdre/; 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="ERsbdre/" Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4B99RQvD001930; Mon, 9 Dec 2024 15:14:32 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=Jf1DnB1tSe8lT308i ZmGeXnhbDqfZIragnRW7aWxZlY=; b=ERsbdre/qxblOqQjFLYpCs4jT6i/KSNkz pBfJrTlcETrqAunBPpVjwBefnXADW3jyYnUff53wzJkhe9CumQzyQyymsKIQg1y2 HE53RpfoJY+0rPCbVNdy0EgmBGKjva6BGu4Fwme4H7rhyDM/iSsgHDr6iH3dwXmG GxLAnvsnd0BtkWOx0jiLcWZSQMjUhLrsz4t8yetYfMNdotfLlbuHWDdGaz2HaDEk TJl4iZsRHoRzT/y/OxrU2lNF45RVjHNcrn0hW0j249FRJa11bNbpPXO6ji/k3A2b 1J4Q8VLRsLEbZH5u9+Hi5acnK6WA+8PAJlCp/9CqHJBv3gE9VEzmw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 43cbsq1djs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 09 Dec 2024 15:14:31 +0000 (GMT) Received: from m0356516.ppops.net (m0356516.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4B9F8iie032663; Mon, 9 Dec 2024 15:14:31 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 43cbsq1djn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 09 Dec 2024 15:14:31 +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 4B9DTqP2032727; Mon, 9 Dec 2024 15:14:30 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 43d0ps7des-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 09 Dec 2024 15:14:30 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4B9FESWO49479938 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 9 Dec 2024 15:14:29 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DDA8A20040; Mon, 9 Dec 2024 15:14:28 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DBCE520043; Mon, 9 Dec 2024 15:14:26 +0000 (GMT) Received: from li-c439904c-24ed-11b2-a85c-b284a6847472.ibm.com.com (unknown [9.43.38.185]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 9 Dec 2024 15:14:26 +0000 (GMT) From: Madhavan Srinivasan To: mpe@ellerman.id.au, npiggin@gmail.com, christophe.leroy@csgroup.eu, naveen@kernel.org, shuah@kernel.org Cc: linuxppc-dev@lists.ozlabs.org, linux-kselftest@vger.kernel.org, Madhavan Srinivasan Subject: [PATCH 2/3] selftest/powerpc/ptrace/ptrace-pkey: Remove duplicate macros Date: Mon, 9 Dec 2024 20:44:17 +0530 Message-ID: <20241209151418.348085-2-maddy@linux.ibm.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241209151418.348085-1-maddy@linux.ibm.com> References: <20241209151418.348085-1-maddy@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-ORIG-GUID: U8u_uvfXx34om2SxO6ddW6d7mtOzVadS X-Proofpoint-GUID: Np7d7_hTcoh8-L7qtazuNgbDHoKACHRt 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 mlxlogscore=835 adultscore=0 lowpriorityscore=0 clxscore=1011 phishscore=0 impostorscore=0 suspectscore=0 spamscore=0 mlxscore=0 priorityscore=1501 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412090117 ptrace-pkey.c test has macros defined which are part of "pkeys.h" header file. Remove those duplicates and include "pkeys.h" Signed-off-by: Madhavan Srinivasan --- .../testing/selftests/powerpc/ptrace/ptrace-pkey.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c b/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c index d89474377f11..6893ed096457 100644 --- a/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c +++ b/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c @@ -7,14 +7,7 @@ */ #include "ptrace.h" #include "child.h" - -#ifndef __NR_pkey_alloc -#define __NR_pkey_alloc 384 -#endif - -#ifndef __NR_pkey_free -#define __NR_pkey_free 385 -#endif +#include "pkeys.h" #ifndef NT_PPC_PKEY #define NT_PPC_PKEY 0x110 @@ -61,11 +54,6 @@ struct shared_info { unsigned long invalid_uamor; }; -static int sys_pkey_alloc(unsigned long flags, unsigned long init_access_rights) -{ - return syscall(__NR_pkey_alloc, flags, init_access_rights); -} - static int child(struct shared_info *info) { unsigned long reg; From patchwork Mon Dec 9 15:14:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Madhavan Srinivasan X-Patchwork-Id: 848530 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 CC1EA1B424E for ; Mon, 9 Dec 2024 15:14:49 +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=1733757292; cv=none; b=V7iJdtVry1RH3XpTbphQMsRwae7ZVTUhNRvaWX7orTq+5VYUKgNy5/6DuzAQM9g4a2+fWyOxPdPOgjgvsN0QhfDEBu3dUYrta5ayI1cnbJD2NpKW6Pgy+NlErDPB1vQ8/VQpEcjhJulKQd2wtI4S3/46cdfq6PqlxhLD7wjFRHo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733757292; c=relaxed/simple; bh=rWpkPpJjnGIoaBlfasc/mIcubPSQmMWDg/04UG54gvs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=glj0kLAtrjUqwZj3M8+T5joMMcGnDduAORh9NXPh4dL3G6tMGv4bk67VOgX3ZrFbNbTx4DOH8+HK+uFEk7ouBWGA8nRAbTTrByEkf2av8BlSMucF2VxiELn5frx2NeIP/1JrOn7Sxep3EarXZP9UGu2a8ZBvPFT7QHDS1l7pAhA= 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=TtMmdhRc; 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="TtMmdhRc" 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 4B99fpie030610; Mon, 9 Dec 2024 15:14: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=BH5TwweUkqOnsc172 vXfteFPatvOsrj0SVX8Z9/kJAI=; b=TtMmdhRcp4DpKeloEAPAS9XbIwC5NpxNj Q33Bh9Ck5fchUFp989l/15e8sfNID5VDfWthdO09EPzlltvquVMtFdgkCrCxBjmr dUebWdLcowruaB6Y3/rA8SZ/mUBu+j/FpaRgk2K6lyeFqYqC5csurmFHJvt+5rPV 3ZzME0psc+AwCidq9tLXWsjBO97af1t+TLDrWXAHiclH5V+sJTzx4r4QntGfHAI1 FsqWY0svkmmhjkjezKwl06ird25O+w4+wx0v0GWjOlC9lgV+yoAiMpHJZpnvn4cv QZCzaNH86BuAlTCR2BHoAaIaX8MyNpQCab8rl+YmcsBixe0wKmsEw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 43cdv8j2cw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 09 Dec 2024 15:14: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 4B9FEbCJ025338; Mon, 9 Dec 2024 15:14:37 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 43cdv8j2cr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 09 Dec 2024 15:14:37 +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 4B9EAMQT000572; Mon, 9 Dec 2024 15:14:35 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 43d1pmy66k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 09 Dec 2024 15:14:35 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4B9FEXbq59179342 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 9 Dec 2024 15:14:33 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A11BD20043; Mon, 9 Dec 2024 15:14:33 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9928B2004B; Mon, 9 Dec 2024 15:14:31 +0000 (GMT) Received: from li-c439904c-24ed-11b2-a85c-b284a6847472.ibm.com.com (unknown [9.43.38.185]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 9 Dec 2024 15:14:31 +0000 (GMT) From: Madhavan Srinivasan To: mpe@ellerman.id.au, npiggin@gmail.com, christophe.leroy@csgroup.eu, naveen@kernel.org, shuah@kernel.org Cc: linuxppc-dev@lists.ozlabs.org, linux-kselftest@vger.kernel.org, Madhavan Srinivasan Subject: [PATCH 3/3] selftest/powerpc/ptrace: Cleanup duplicate macro definitions Date: Mon, 9 Dec 2024 20:44:18 +0530 Message-ID: <20241209151418.348085-3-maddy@linux.ibm.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241209151418.348085-1-maddy@linux.ibm.com> References: <20241209151418.348085-1-maddy@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: 7bscHaX4F1XZSuaSPKyuX4qUhvgbviZm X-Proofpoint-ORIG-GUID: sj-gzOJt_bnju5K1pGraPhwvZ-PPWFnP 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 priorityscore=1501 impostorscore=0 lowpriorityscore=0 spamscore=0 clxscore=1011 mlxscore=0 malwarescore=0 adultscore=0 phishscore=0 suspectscore=0 mlxlogscore=904 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412090117 Both core-pkey.c and ptrace-pkey.c tests have similar macro definitions, move them to "pkeys.h" and remove the macro definitions from the C file. Signed-off-by: Madhavan Srinivasan --- tools/testing/selftests/powerpc/include/pkeys.h | 8 ++++++++ tools/testing/selftests/powerpc/ptrace/core-pkey.c | 8 -------- tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c | 8 -------- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/tools/testing/selftests/powerpc/include/pkeys.h b/tools/testing/selftests/powerpc/include/pkeys.h index 51729d9a7111..3a0129467de6 100644 --- a/tools/testing/selftests/powerpc/include/pkeys.h +++ b/tools/testing/selftests/powerpc/include/pkeys.h @@ -35,10 +35,18 @@ #define __NR_pkey_alloc 384 #define __NR_pkey_free 385 +#ifndef NT_PPC_PKEY +#define NT_PPC_PKEY 0x110 +#endif + #define PKEY_BITS_PER_PKEY 2 #define NR_PKEYS 32 #define PKEY_BITS_MASK ((1UL << PKEY_BITS_PER_PKEY) - 1) +#define AMR_BITS_PER_PKEY 2 +#define PKEY_REG_BITS (sizeof(u64) * 8) +#define pkeyshift(pkey) (PKEY_REG_BITS - ((pkey + 1) * AMR_BITS_PER_PKEY)) + inline unsigned long pkeyreg_get(void) { return mfspr(SPRN_AMR); diff --git a/tools/testing/selftests/powerpc/ptrace/core-pkey.c b/tools/testing/selftests/powerpc/ptrace/core-pkey.c index 31c9bf6d95db..f8ff05e5bf6e 100644 --- a/tools/testing/selftests/powerpc/ptrace/core-pkey.c +++ b/tools/testing/selftests/powerpc/ptrace/core-pkey.c @@ -18,18 +18,10 @@ #include "child.h" #include "pkeys.h" -#ifndef NT_PPC_PKEY -#define NT_PPC_PKEY 0x110 -#endif - #ifndef PKEY_DISABLE_EXECUTE #define PKEY_DISABLE_EXECUTE 0x4 #endif -#define AMR_BITS_PER_PKEY 2 -#define PKEY_REG_BITS (sizeof(u64) * 8) -#define pkeyshift(pkey) (PKEY_REG_BITS - ((pkey + 1) * AMR_BITS_PER_PKEY)) - #define CORE_FILE_LIMIT (5 * 1024 * 1024) /* 5 MB should be enough */ static const char core_pattern_file[] = "/proc/sys/kernel/core_pattern"; diff --git a/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c b/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c index 6893ed096457..5d528d0ea9d1 100644 --- a/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c +++ b/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c @@ -9,18 +9,10 @@ #include "child.h" #include "pkeys.h" -#ifndef NT_PPC_PKEY -#define NT_PPC_PKEY 0x110 -#endif - #ifndef PKEY_DISABLE_EXECUTE #define PKEY_DISABLE_EXECUTE 0x4 #endif -#define AMR_BITS_PER_PKEY 2 -#define PKEY_REG_BITS (sizeof(u64) * 8) -#define pkeyshift(pkey) (PKEY_REG_BITS - ((pkey + 1) * AMR_BITS_PER_PKEY)) - static const char user_read[] = "[User Read (Running)]"; static const char user_write[] = "[User Write (Running)]"; static const char ptrace_read_running[] = "[Ptrace Read (Running)]";