From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 16AAB3857C63 for ; Fri, 5 Feb 2021 02:31:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 16AAB3857C63 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 1152VdP6029261 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 4 Feb 2021 21:31:44 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 1152VdP6029261 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 8A8A51E945; Thu, 4 Feb 2021 21:31:39 -0500 (EST) Subject: Re: [PATCH v5 01/25] New target methods for memory tagging support To: Luis Machado , gdb-patches@sourceware.org References: <20210127202112.2485702-1-luis.machado@linaro.org> <20210127202112.2485702-2-luis.machado@linaro.org> From: Simon Marchi Message-ID: Date: Thu, 4 Feb 2021 21:31:39 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <20210127202112.2485702-2-luis.machado@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Fri, 5 Feb 2021 02:31:39 +0000 X-Spam-Status: No, score=-10.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, 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, 05 Feb 2021 02:31:47 -0000 On 2021-01-27 3:20 p.m., Luis Machado via Gdb-patches wrote: > Updates on v5: > > - Remove the memory_tagging global (in favor of setting a specific print > option) and related functions. > > Updates on v4: > > - Updated the return types of fetch/store member functions from int to bool. > - Implemented target-debug type print helpers. > - Renamed global memtag to memory_tagging. > > Updates on v3: > > - Updated the code documentation for the fetch_memtags and store_memtags > methods. > > Updates on v2: > > - Added type parameter to fetch_memtags/store_memtags hooks. > > -- > > This patch starts adding some of the generic pieces to accomodate memory > tagging. > > We have three new target methods: > > - supports_memory_tagging: Checks if the target supports memory tagging. This > defaults to false for targets that don't support memory tagging. > > - fetch_memtags: Fetches the allocation tags associated with a particular > memory range [address, address + length). > > The default is to return 0 without returning any tags. This should only > be called if memory tagging is supported. > > - store_memtags: Stores a set of allocation tags for a particular memory > range [address, address + length). > > The default is to return 0. This should only > be called if memory tagging is supported. > > gdb/ChangeLog: > > YYYY-MM-DD Luis Machado > > * remote.c (remote_target) : New method > override. > : New method override. > : New method override. > (remote_target::supports_memory_tagging): New method. > (remote_target::fetch_memtags): New method. > (remote_target::store_memtags): New method. > * target-delegates.c: Regenerate. > * target.h (struct target_ops) : New virtual > method. > : New virtual method. > : New virtual method. > (target_supports_memory_tagging): Define. > (target_fetch_memtags): Define. > (target_store_memtags): Define. > * target-debug.h (target_debug_print_size_t) > (target_debug_print_const_gdb_byte_vector_r) > (target_debug_print_gdb_byte_vector_r): New functions. > --- > gdb/remote.c | 34 +++++++++++++++ > gdb/target-debug.h | 24 +++++++++++ > gdb/target-delegates.c | 95 ++++++++++++++++++++++++++++++++++++++++++ > gdb/target.h | 41 ++++++++++++++++++ > 4 files changed, 194 insertions(+) > > diff --git a/gdb/remote.c b/gdb/remote.c > index bc995edc53..b130f1ddae 100644 > --- a/gdb/remote.c > +++ b/gdb/remote.c > @@ -690,6 +690,14 @@ class remote_target : public process_stratum_target > int remove_exec_catchpoint (int) override; > enum exec_direction_kind execution_direction () override; > > + bool supports_memory_tagging () override; > + > + bool fetch_memtags (CORE_ADDR address, size_t len, > + gdb::byte_vector &tags, int type) override; > + > + bool store_memtags (CORE_ADDR address, size_t len, > + const gdb::byte_vector &tags, int type) override; The indentation is a bit off here. Otherwise, LGTM. Simon