From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 4594B384A40A for ; Mon, 21 Dec 2020 13:34:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4594B384A40A Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DCF4E101E; Mon, 21 Dec 2020 05:34:45 -0800 (PST) Received: from [192.168.1.19] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 482973F6CF; Mon, 21 Dec 2020 05:34:45 -0800 (PST) Subject: Re: [PATCH v4 4/6] linux: Add compatibility definitions to sys/prctl.h for MTE To: Siddhesh Poyarekar , Richard Earnshaw , libc-alpha@sourceware.org References: <20201218192957.11035-1-rearnsha@arm.com> <20201218192957.11035-5-rearnsha@arm.com> <3257efec-348c-6047-8afd-c91c74e2d06e@gotplt.org> From: Richard Earnshaw Message-ID: <5ff8558e-9cd8-6df0-ea45-2050054d98c6@foss.arm.com> Date: Mon, 21 Dec 2020 13:34:44 +0000 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: <3257efec-348c-6047-8afd-c91c74e2d06e@gotplt.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3498.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2020 13:34:56 -0000 On 21/12/2020 13:32, Siddhesh Poyarekar wrote: > On 12/19/20 12:59 AM, Richard Earnshaw via Libc-alpha wrote: >> >> Older versions of the Linux kernel headers obviously lack support for >> memory tagging, but we still want to be able to build in support when >> using those (obviously it can't be enabled on such systems). >> >> The linux kernel extensions are made to the platform-independent >> header (linux/prctl.h), so this patch takes a similar approach. >> --- >>   sysdeps/unix/sysv/linux/sys/prctl.h | 18 ++++++++++++++++++ >>   1 file changed, 18 insertions(+) > > Please put the additions into an architecture-specific > sysdeps/unix/sysv/linux/aarch64/sys/prctl.h and include_next this file > from there. > >> >> diff --git a/sysdeps/unix/sysv/linux/sys/prctl.h >> b/sysdeps/unix/sysv/linux/sys/prctl.h >> index 7f748ebeeb..4d01379c23 100644 >> --- a/sysdeps/unix/sysv/linux/sys/prctl.h >> +++ b/sysdeps/unix/sysv/linux/sys/prctl.h >> @@ -21,6 +21,24 @@ >>  #include >>  #include   /*  The magic values come from here  */ >>   >> +/* Recent extensions to linux which may post-date the kernel headers >> +   we're picking up...  */ >> + >> +/* Memory tagging control operations (for AArch64).  */ >> +#ifndef PR_TAGGED_ADDR_ENABLE >> +# define PR_TAGGED_ADDR_ENABLE    (1UL << 8) >> +#endif >> + >> +#ifndef PR_MTE_TCF_SHIFT >> +# define PR_MTE_TCF_SHIFT    1 >> +# define PR_MTE_TCF_NONE    (0UL << PR_MTE_TCF_SHIFT) >> +# define PR_MTE_TCF_SYNC    (1UL << PR_MTE_TCF_SHIFT) >> +# define PR_MTE_TCF_ASYNC    (2UL << PR_MTE_TCF_SHIFT) >> +# define PR_MTE_TCF_MASK    (3UL << PR_MTE_TCF_SHIFT) >> +# define PR_MTE_TAG_SHIFT    3 >> +# define PR_MTE_TAG_MASK    (0xffffUL << PR_MTE_TAG_SHIFT) >> +#endif >> + >>  __BEGIN_DECLS >>   >>  /* Control process execution.  */ > > The standard linux kernel headers have this in an architecture independent file, so why should glibc need to do this differently? R.