From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id Z9q0K9p5kl/SVgAAWB0awg (envelope-from ) for ; Fri, 23 Oct 2020 02:36:10 -0400 Received: by simark.ca (Postfix, from userid 112) id A5D531EE09; Fri, 23 Oct 2020 02:36:10 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 01EFD1E552 for ; Fri, 23 Oct 2020 02:36:10 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5329A3858002; Fri, 23 Oct 2020 06:36:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5329A3858002 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1603434969; bh=1124oY106mVh+616n2dJsZYsHrVfBvvgGlkeF75ud0g=; h=Date:To:In-Reply-To:Subject:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=oVX/b07rl/TVW3Mx3xtQTb+F8+6eCj8EHV01K9nRqWy4LgAo2m1jk6ow375stmxTa Gepnb3KW5f7crKxyCf6mgtZNWiHD2iu9iZKb2UUnJ4lxDlurdf5OkFtIo1+BwX9Az1 UHhArnnj/Wyq/hYjCLAFlgEiTpYmMaIgf2ozEsIE= 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> To: Luis Machado 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-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: , From: Eli Zaretskii via Gdb-patches Reply-To: Eli Zaretskii Cc: david.spickett@linaro.org, gdb-patches@sourceware.org Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" > 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.