From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id A554E3858002 for ; Fri, 23 Oct 2020 06:36:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A554E3858002 Received: from fencepost.gnu.org ([2001:470:142:3::e]:60390) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVqgG-00005A-NH; Fri, 23 Oct 2020 02:36:06 -0400 Received: from [176.228.60.248] (port=2555 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kVqgE-0005EO-Ug; Fri, 23 Oct 2020 02:36:04 -0400 Date: Fri, 23 Oct 2020 09:35:47 +0300 Message-Id: <837drhla9o.fsf@gnu.org> From: Eli Zaretskii To: Luis Machado Cc: gdb-patches@sourceware.org, david.spickett@linaro.org In-Reply-To: <20201022200014.5189-21-luis.machado@linaro.org> (message from Luis Machado via Gdb-patches on Thu, 22 Oct 2020 17:00:10 -0300) Subject: Re: [PATCH v2 20/24] Documentation for the new mtag commands References: <20201022200014.5189-1-luis.machado@linaro.org> <20201022200014.5189-21-luis.machado@linaro.org> X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, 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: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2020 06:36:07 -0000 > Date: Thu, 22 Oct 2020 17:00:10 -0300 > From: Luis Machado via Gdb-patches > Cc: david.spickett@linaro.org > > +Memory tagging is a memory protection technology that uses tags to validate > +memory accesses through pointers. The pointer tag must match the memory tag > +for the memory access to be validated. ^^^^^^^^^^^^^^^ I guess "to be valid" is more clear, as "validated" can be interpreted as the process of validation, not its result. > +There are two types of tags: logical and allocation. A logical tag is > +stored in the pointers themselves. A allocation tag is the tag associated ^ ^^^ "An" and "a" Also, this text fails to explain that (AFAIU) these 2 types of tags work together to allow the access validation. IOW, both types need to be present for the mechanism to work. I originally interpreted the text as meaning that tags come in 2 flavors, depending on how the hardware implemented the facility. > +@kindex mtag setltag > +@item mtag setltag @var{address_expression} @var{tag_bytes} > +Print the address given by @var{address_expression}, augmented with a logical It is strange for a command whose name is "set..." to print something. I'd expect it to set something instead. is the above description correct? > +@item mtag setatag @var{starting_address} @var{length} @var{tag_bytes} > +Set the allocation tag(s) for memory range @r{[}@var{starting_address}, > +@var{starting_address} + @var{length}@r{)} to @var{tag_bytes}. This is what I'd expect from setltag to do. > +@kindex mtag check > +@item mtag check @var{address_expression} > +Check that the logical tag stored at the address given by > +@var{address_expression} matches the allocation tag for the same address. This test should say that this check performs the same validation as is done in hardware when memory is accessed through a pointer. Saying that (assuming I understood correctly) will go a long way towards causing this facility to make much more sense to the reader. Thanks.