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 D2D083870884 for ; Fri, 17 Jul 2020 06:11:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D2D083870884 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=eliz@gnu.org Received: from fencepost.gnu.org ([2001:470:142:3::e]:36399) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jwJaV-00072g-Mi; Fri, 17 Jul 2020 02:11:15 -0400 Received: from [176.228.60.248] (port=1026 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jwJaV-0001uO-1V; Fri, 17 Jul 2020 02:11:15 -0400 Date: Fri, 17 Jul 2020 09:11:01 +0300 Message-Id: <83imemk6x6.fsf@gnu.org> From: Eli Zaretskii To: Luis Machado Cc: gdb-patches@sourceware.org, Alan.Hayward@arm.com, catalin.marinas@arm.com, david.spickett@linaro.org In-Reply-To: <20200715194513.16641-20-luis.machado@linaro.org> (message from Luis Machado via Gdb-patches on Wed, 15 Jul 2020 16:45:09 -0300) Subject: Re: [PATCH 19/23] Documentation for the new mtag commands References: <20200715194513.16641-1-luis.machado@linaro.org> <20200715194513.16641-20-luis.machado@linaro.org> X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, 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, 17 Jul 2020 06:11:18 -0000 > Date: Wed, 15 Jul 2020 16:45:09 -0300 > From: Luis Machado via Gdb-patches > Cc: catalin.marinas@arm.com, david.spickett@linaro.org > > * gdb.textinfo (Memory Tagging): New subsection. > (AArch64 Memory Tagging Extension): New subsection. gdb.texinfo (without the "t"). Also, we usually combine functions and sections that have the same change description, as in * gdb.texinfo (Memory Tagging, AArch64 Memory Tagging Extension): New subsections. > +Memory tagging is a memory protection technology that validates accesses > +through pointers via a tag. The "via a tag" part is ambiguous: it is not clear whether it refers to the access or to the protection. Suggest a slight rewording: Memory tagging is a memory protection technology that uses tags to validate memory accesses through pointers. > Both the pointer tag and the memory tag in the > +physical address space must match for the memory access to be validated. Here, it is unclear what should match what. Do you mean that the pointer tag must match the memory tag? or do you mean something else? If the former, then where does the "physical address space" part come into the picture? > +There are two types of tags: logical and allocation. The logical tag is ^^^^^^^^^^^^^^^ "A logical tag" > +stored in the pointers themselves. The allocation tag is the tag associated ^^^^^^^^^^^^^^^^^^ Ditto. > +with the physical address space, against which the logical tags from pointers > +are validated. "Validated" or "compared"? The latter is much less vague, so if it's accurate, I think we should prefer it. > +If the underlying architecture supports memory tagging, like AArch64, ^^^^^^^^^^^^ "like AArch64 does" > +@item mtag showltag @var{address_expression} > +Show the logical tag contained in the pointer resulting from evaluating the > +argument expression. This is slightly better, IMO: Show the logical tag stored at the address given by @var{address_expression}. It avoids two words in a row that end in "ing", which makes it a mouthful. > +@item mtag setltag @var{address_expression} @var{tag_bytes} > +Print the resulting pointer from evaluating the argument expression with a > +logical tag of @var{tag_bytes}. I don't understand what "print the resulting point" means in this context, and the sentence confused me, perhaps for this very reason. can you elaborate what this means? > +@item mtag showatag @var{address_expression} > +Show the allocation tag from the memory address pointed to by the evaluation > +of the argument expression. See above: I'd rephrase this similarly to showltag. > +@item mtag setatag @var{starting_address} @var{length} @var{tag_bytes} > +Set the allocation tag for memory range @r{[}@var{starting_address}, > +@var{starting_address} + @var{length}@r{)} to @var{tag_bytes}. So setatag _sets_ a tag, but setltag _prints_ something? Isn't that inconsistent? > +@item mtag check @var{address_expression} > +Given the pointer resulting from evaluating the argument expression, check that > +the logical tag and the allocation tags match. Which logical tag and which allocation tag are being tested for a match here? > +When @value{GDBN} is debugging the AArch64 architecture, the program is > +using the v8.5-A feature Memory Tagging Extension (MTE) and there is support > +in the kernel for MTE, @value{GDBN} will make memory tagging functionality > +available for inspection and editing of logical and allocation tags. Please add here a cross-reference to "Memory Tagging" subsection. > +To aid debugging, @value{GDBN} will output additional information when SIGSEGV > +signals are generated as a result of memory tag failures. Can you add some minimal description of the additional information? > +A new register, @code{tag_ctl}, is made available through the In what sense is this register "new"? Perhaps you mean "special"? Thanks.