From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from earwig.ash.relay.mailchannels.net (earwig.ash.relay.mailchannels.net [23.83.222.54]) by sourceware.org (Postfix) with ESMTPS id C6F603836C73 for ; Wed, 25 Nov 2020 15:05:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C6F603836C73 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gotplt.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=siddhesh@gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id EE22E12060C; Wed, 25 Nov 2020 15:05:14 +0000 (UTC) Received: from pdx1-sub0-mail-a90.g.dreamhost.com (100-96-5-21.trex.outbound.svc.cluster.local [100.96.5.21]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 0EEB6122216; Wed, 25 Nov 2020 15:05:12 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from pdx1-sub0-mail-a90.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.18.10); Wed, 25 Nov 2020 15:05:14 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Average-Desert: 6454e7dd50342b44_1606316714550_1514530395 X-MC-Loop-Signature: 1606316714550:3771118571 X-MC-Ingress-Time: 1606316714549 Received: from pdx1-sub0-mail-a90.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a90.g.dreamhost.com (Postfix) with ESMTP id 5F1797F955; Wed, 25 Nov 2020 07:05:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gotplt.org; h=subject:to :cc:references:from:message-id:date:mime-version:in-reply-to :content-type:content-transfer-encoding; s=gotplt.org; bh=G1qNU9 7kbRqxWEX8QwYjpIcD7eQ=; b=YHdm7GC0upwHCSvvEmTfRTZSaUw8ATDJ9eaCQV uGDir4j/8wk637dDeX+EQAj48lsy8K83oeCbzUQAPxA4xlDUj+omlHqkKuwS43lz j4/029sYBPJ0pGm1MF9wFgfKVIMLLFMDYEVv2Mc4YeqOCfzfus/tCzK8vCsHLIuC gCVug= Received: from [192.168.1.111] (unknown [1.186.101.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a90.g.dreamhost.com (Postfix) with ESMTPSA id A83957F25D; Wed, 25 Nov 2020 07:05:09 -0800 (PST) Subject: Re: [PATCH v3 1/8] config: Allow memory tagging to be enabled when configuring glibc To: Richard Earnshaw , libc-alpha@sourceware.org Cc: Richard Earnshaw References: <20201123154236.25809-1-rearnsha@arm.com> <20201123154236.25809-2-rearnsha@arm.com> X-DH-BACKEND: pdx1-sub0-mail-a90 From: Siddhesh Poyarekar Message-ID: <07c2b94b-b049-aa4a-7abd-3d0eff2cb711@gotplt.org> Date: Wed, 25 Nov 2020 20:35:04 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <20201123154236.25809-2-rearnsha@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, 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: Wed, 25 Nov 2020 15:05:24 -0000 On 11/23/20 9:12 PM, Richard Earnshaw via Libc-alpha wrote: > > This patch adds the configuration machinery to allow memory tagging to be > enabled from the command line via the configure option --enable-memory-tagging. > > The current default is off, though in time we may change that once the API > is more stable. > --- > INSTALL | 14 ++++++++++++++ > config.h.in | 3 +++ > config.make.in | 2 ++ > configure | 17 +++++++++++++++++ > configure.ac | 10 ++++++++++ > manual/install.texi | 13 +++++++++++++ > 6 files changed, 59 insertions(+) > > diff --git a/INSTALL b/INSTALL > index 2b00f80df5..f2476df6c0 100644 > --- a/INSTALL > +++ b/INSTALL > @@ -142,6 +142,20 @@ if 'CFLAGS' is specified it must enable optimization. For example: > non-CET processors. '--enable-cet' has been tested for i686, > x86_64 and x32 on CET processors. > > +'--enable-memory-tagging' > + Enable memory tagging support on architectures that support it. > + When the GNU C Library is built with this option then the resulting > + library will be able to control the use of tagged memory when > + hardware support is present by use of the tunable > + 'glibc.memtag.enable'. This includes the generation of tagged > + memory when using the 'malloc' APIs. > + > + At present only AArch64 platforms with MTE provide this > + functionality, although the library will still operate (without > + memory tagging) on older versions of the architecture. > + > + The default is to disable support for memory tagging. > + > '--disable-profile' > Don't build libraries with profiling information. You may want to > use this option if you don't plan to do profiling. > diff --git a/config.h.in b/config.h.in > index b823c8e080..2f4c626c19 100644 > --- a/config.h.in > +++ b/config.h.in > @@ -160,6 +160,9 @@ > /* Define if __stack_chk_guard canary should be randomized at program startup. */ > #undef ENABLE_STACKGUARD_RANDOMIZE > > +/* Define if memory tagging support should be enabled. */ > +#undef _LIBC_MTAG > + > /* Package description. */ > #undef PKGVERSION > > diff --git a/config.make.in b/config.make.in > index 1ac9417245..7ae27564fd 100644 > --- a/config.make.in > +++ b/config.make.in > @@ -84,6 +84,8 @@ mach-interface-list = @mach_interface_list@ > > experimental-malloc = @experimental_malloc@ > > +memory-tagging = @memory_tagging@ > + > nss-crypt = @libc_cv_nss_crypt@ > static-nss-crypt = @libc_cv_static_nss_crypt@ > > diff --git a/configure b/configure > index 4795e721e5..d22654739f 100755 > --- a/configure > +++ b/configure > @@ -676,6 +676,7 @@ build_nscd > libc_cv_static_nss_crypt > libc_cv_nss_crypt > build_crypt > +memory_tagging > experimental_malloc > enable_werror > all_warnings > @@ -781,6 +782,7 @@ enable_all_warnings > enable_werror > enable_multi_arch > enable_experimental_malloc > +enable_memory_tagging > enable_crypt > enable_nss_crypt > enable_systemtap > @@ -1450,6 +1452,8 @@ Optional Features: > architectures > --disable-experimental-malloc > disable experimental malloc features > + --enable-memory-tagging enable memory tagging if supported by the > + architecture [default=no] I wonder if that phrasing implies that the flag is disabled if memory tagging is not supported by the architecture. The description in INSTALL (Enable memory tagging support on architectures that support it) seems a bit more precise. Siddhesh