From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id UVWoCm4Yk18AaQAAWB0awg (envelope-from ) for ; Fri, 23 Oct 2020 13:52:46 -0400 Received: by simark.ca (Postfix, from userid 112) id 1EBA61EE09; Fri, 23 Oct 2020 13:52:46 -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 60F7A1E552 for ; Fri, 23 Oct 2020 13:52:45 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A1379385783E; Fri, 23 Oct 2020 17:52:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A1379385783E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1603475564; bh=or5UjaBpjz8Hui5wRuzZ2wBD2cnywq9c0Psgpqw8fOM=; 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=tMtAuUkZ5T3gBTp5GMGsIFSl9b1HbSGxOK2mUTjsi7c3QjNZH0D0qavY5uzyBNPv6 6PXQWkyLeu6rUPim5VupJy0SjsvAHMtMtP2cnPwJ0h50N1Z4XVLTpJ2+sdL+M+twjZ wYXoN3GFZLA8IelRRMkWChgMqmfo4xEaqQs8nqEo= Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 33D52385783E for ; Fri, 23 Oct 2020 17:52:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 33D52385783E Received: from fencepost.gnu.org ([2001:470:142:3::e]:55229) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kW1F3-0003mZ-Ke; Fri, 23 Oct 2020 13:52:41 -0400 Received: from [176.228.60.248] (port=4601 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kW1Ez-0004FI-Ns; Fri, 23 Oct 2020 13:52:41 -0400 Date: Fri, 23 Oct 2020 20:52:23 +0300 Message-Id: <83y2jwj0dk.fsf@gnu.org> To: Luis Machado In-Reply-To: (message from Luis Machado on Fri, 23 Oct 2020 11:33:36 -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> <837drhla9o.fsf@gnu.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" > Cc: gdb-patches@sourceware.org, david.spickett@linaro.org > From: Luis Machado > Date: Fri, 23 Oct 2020 11:33:36 -0300 > > But, in general, there will always be a memory-side tag against which a > logical tag (contained in a pointer, for example) will be matched against. This is the crucial aspect that should be stated, IMO. > >> +@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? > > > > Yes. This is one area that I'd welcome some discussion/feedback. > > We don't always have a modifiable value as an argument to the "mtag > setltag" command. We could have a constant value, a read-only value, > some reference or some expression containing multiple pointers. > > Plus, the most natural way to modify a value in GDB is through the > existing "set variable" command. > > The main goal is to be able to augment a particular address with a given > logical tag. That augmented value can then be used to set a particular > pointer or value. It will be stored in the history anyway, so that's > already a value that you can use. > > There won't be much reason to set logical tags other than if you're > chasing bugs and trying to cause one. It is one additional knob so that > you won't need to craft the tagged pointer by hand. Maybe the command should be called something other than "set...", then? > >> +@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. > > Does it make it more clear if I add the following: > > "This essentially emulates the hardware validation that is done when > tagged memory is accessed through a pointer, but does not cause a memory > fault as it would during hardware validation. > > It can be used to inspect potential memory tagging violations in the > running process, before any faults get triggered." Yes, this is a good addition, thanks.