From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49F59C433E0 for ; Mon, 3 Aug 2020 11:37:28 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AD83B206E2 for ; Mon, 3 Aug 2020 11:37:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AD83B206E2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4BKwpt5xTrzDqWq for ; Mon, 3 Aug 2020 21:37:26 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.ibm.com (client-ip=148.163.158.5; helo=mx0b-001b2d01.pphosted.com; envelope-from=sandipan@linux.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com 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 lists.ozlabs.org (Postfix) with ESMTPS id 4BKwmz6Kh8zDqTX for ; Mon, 3 Aug 2020 21:35:47 +1000 (AEST) Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 073BWxJ7047177; Mon, 3 Aug 2020 07:35:42 -0400 Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 32pcc390qe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 03 Aug 2020 07:35:42 -0400 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 073BZaCb031129; Mon, 3 Aug 2020 11:35:40 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma04ams.nl.ibm.com with ESMTP id 32n01824h4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 03 Aug 2020 11:35:40 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 073BZcMq33227090 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 3 Aug 2020 11:35:38 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DDEBDA4053; Mon, 3 Aug 2020 11:35:37 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D3364A4051; Mon, 3 Aug 2020 11:35:36 +0000 (GMT) Received: from [9.199.32.186] (unknown [9.199.32.186]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 3 Aug 2020 11:35:36 +0000 (GMT) Subject: Re: [PATCH v2] selftests/powerpc: Fix pkey syscall redefinitions To: Michael Ellerman References: <566dde119ce71f00f9642807ba30ceb7f54c9bfa.1596441105.git.sandipan@linux.ibm.com> <8736540z3w.fsf@mpe.ellerman.id.au> From: Sandipan Das Message-ID: <8b0e0ff9-5dad-7abb-de15-6193afe4f66b@linux.ibm.com> Date: Mon, 3 Aug 2020 17:05:35 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <8736540z3w.fsf@mpe.ellerman.id.au> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-08-03_09:2020-08-03, 2020-08-03 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 mlxlogscore=999 priorityscore=1501 malwarescore=0 mlxscore=0 phishscore=0 spamscore=0 suspectscore=0 lowpriorityscore=0 impostorscore=0 bulkscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008030086 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sachinp@linux.vnet.ibm.com, aneesh.kumar@linux.ibm.com, linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On 03/08/20 4:34 pm, Michael Ellerman wrote: > Sandipan Das writes: >> On some distros, there are conflicts w.r.t to redefinition >> of pkey syscall numbers which cause build failures. This >> fixes them. >> >> Reported-by: Sachin Sant >> Signed-off-by: Sandipan Das >> --- >> Previous versions can be found at: >> v1: https://lore.kernel.org/linuxppc-dev/20200803074043.466809-1-sandipan@linux.ibm.com/ >> >> Changes in v2: >> - Fix incorrect commit message. >> >> --- >> tools/testing/selftests/powerpc/include/pkeys.h | 5 +++++ >> 1 file changed, 5 insertions(+) >> >> diff --git a/tools/testing/selftests/powerpc/include/pkeys.h b/tools/testing/selftests/powerpc/include/pkeys.h >> index 6ba95039a034..26eef5c1f8ea 100644 >> --- a/tools/testing/selftests/powerpc/include/pkeys.h >> +++ b/tools/testing/selftests/powerpc/include/pkeys.h >> @@ -31,8 +31,13 @@ >> >> #define SI_PKEY_OFFSET 0x20 >> >> +#undef SYS_pkey_mprotect >> #define SYS_pkey_mprotect 386 > > We shouldn't undef them. > > They should obviously never change, but if the system headers already > have a definition then we should use that, so I think it should be: > > #ifndef SYS_pkey_mprotect > #define SYS_pkey_mprotect 386 > #endif > Agreed. This had me confused. $ grep -nr "#define __NR_pkey_" /usr/include/ /usr/include/asm-generic/unistd.h:767:#define __NR_pkey_mprotect 288 /usr/include/asm-generic/unistd.h:769:#define __NR_pkey_alloc 289 /usr/include/asm-generic/unistd.h:771:#define __NR_pkey_free 290 /usr/include/powerpc64le-linux-gnu/asm/unistd_32.h:374:#define __NR_pkey_alloc 384 /usr/include/powerpc64le-linux-gnu/asm/unistd_32.h:375:#define __NR_pkey_free 385 /usr/include/powerpc64le-linux-gnu/asm/unistd_32.h:376:#define __NR_pkey_mprotect 386 /usr/include/powerpc64le-linux-gnu/asm/unistd_64.h:365:#define __NR_pkey_alloc 384 /usr/include/powerpc64le-linux-gnu/asm/unistd_64.h:366:#define __NR_pkey_free 385 /usr/include/powerpc64le-linux-gnu/asm/unistd_64.h:367:#define __NR_pkey_mprotect 386 ... But it looks like including unistd.h from a C program picks the right values. - Sandipan