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=-8.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 AD6FDC433F1 for ; Mon, 27 Jul 2020 03:31:02 +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 E3650206D8 for ; Mon, 27 Jul 2020 03:31:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E3650206D8 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 4BFQLp1BNGzF0gt for ; Mon, 27 Jul 2020 13:30:58 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.ibm.com (client-ip=148.163.158.5; helo=mx0a-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 mx0a-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 4BFQHT6KjNzF0QP for ; Mon, 27 Jul 2020 13:28:05 +1000 (AEST) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 06R31qnb172746; Sun, 26 Jul 2020 23:27:52 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 32ggwwpbq1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 26 Jul 2020 23:27:52 -0400 Received: from m0098420.ppops.net (m0098420.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 06R3MHZ6025695; Sun, 26 Jul 2020 23:27:52 -0400 Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0b-001b2d01.pphosted.com with ESMTP id 32ggwwpbpt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 26 Jul 2020 23:27:51 -0400 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 06R3DJEG014882; Mon, 27 Jul 2020 03:27:50 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma06ams.nl.ibm.com with ESMTP id 32gcqghrak-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Jul 2020 03:27:50 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 06R3RkIS61145292 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 27 Jul 2020 03:27:47 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DF9EF11C04A; Mon, 27 Jul 2020 03:27:46 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 642CF11C050; Mon, 27 Jul 2020 03:27:45 +0000 (GMT) Received: from [9.199.36.51] (unknown [9.199.36.51]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 27 Jul 2020 03:27:45 +0000 (GMT) Subject: Re: [PATCH 5/5] selftests/powerpc: Add test for pkey siginfo verification To: Michael Ellerman , Christophe Leroy References: <87365egymc.fsf@mpe.ellerman.id.au> <20200726164009.Horde.J2bKDAPkYDkRMsx2Qnk8OQ8@messagerie.si.c-s.fr> <87zh7lg7g5.fsf@mpe.ellerman.id.au> From: Sandipan Das Message-ID: <7c0b5b72-d82b-ac6a-8f5c-f1a7c55d14dc@linux.ibm.com> Date: Mon, 27 Jul 2020 08:57:44 +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: <87zh7lg7g5.fsf@mpe.ellerman.id.au> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-07-27_02:2020-07-24, 2020-07-27 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 adultscore=0 priorityscore=1501 lowpriorityscore=0 spamscore=0 mlxlogscore=999 phishscore=0 impostorscore=0 clxscore=1011 bulkscore=0 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007270016 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: fweimer@redhat.com, aneesh.kumar@linux.ibm.com, linuxram@us.ibm.com, linuxppc-dev@lists.ozlabs.org, bauerman@linux.ibm.com Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On 27/07/20 5:22 am, Michael Ellerman wrote: > Christophe Leroy writes: >> Michael Ellerman a écrit : >>> Sandipan Das writes: >>>> diff --git a/tools/testing/selftests/powerpc/mm/pkey_siginfo.c >>>> b/tools/testing/selftests/powerpc/mm/pkey_siginfo.c >>>> new file mode 100644 >>>> index 0000000000000..58605c53d495d >>>> --- /dev/null >>>> +++ b/tools/testing/selftests/powerpc/mm/pkey_siginfo.c >>>> @@ -0,0 +1,332 @@ >>> ... >>>> + >>>> +static void *protect(void *p) >>>> +{ >>>> + unsigned long rights; >>>> + unsigned int *base; >>>> + size_t size; >>>> + int tid, i; >>>> + >>>> + tid = gettid(); >>> >>> pkey_siginfo.c: In function 'protect': >>> pkey_siginfo.c:103:8: error: implicit declaration of function >>> 'gettid' [-Werror=implicit-function-declaration] >>> tid = gettid(); >>> ^ >>> >>> >>> On Ubuntu 18.04 at least. >> >> See https://man7.org/linux/man-pages/man2/gettid.2.html >> >> Added in glibc 2.30 > > Thanks, this seems to work: > > diff --git a/tools/testing/selftests/powerpc/include/utils.h b/tools/testing/selftests/powerpc/include/utils.h > index 69d16875802d..71d2924f5b8b 100644 > --- a/tools/testing/selftests/powerpc/include/utils.h > +++ b/tools/testing/selftests/powerpc/include/utils.h > @@ -42,6 +42,16 @@ int perf_event_enable(int fd); > int perf_event_disable(int fd); > int perf_event_reset(int fd); > > +#if !defined(__GLIBC_PREREQ) || !__GLIBC_PREREQ(2, 30) > +#include > +#include > + > +static inline pid_t gettid(void) > +{ > + return syscall(SYS_gettid); > +} > +#endif > + > static inline bool have_hwcap(unsigned long ftr) > { > return ((unsigned long)get_auxv_entry(AT_HWCAP) & ftr) == ftr; > > > cheers > Thanks for catching this. Will add these changes to v2. - Sandipan