From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id i0UdJPqxHGAOEgAAWB0awg (envelope-from ) for ; Thu, 04 Feb 2021 21:48:26 -0500 Received: by simark.ca (Postfix, from userid 112) id 855221EFCB; Thu, 4 Feb 2021 21:48:26 -0500 (EST) 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 C58DE1E945 for ; Thu, 4 Feb 2021 21:48:25 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7A482385E001; Fri, 5 Feb 2021 02:48:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7A482385E001 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1612493305; bh=ufOsI3XNbqjxPaqm2a5plWhJrRzT2kGULePC/vCZ5M8=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=paWQK9jOMgpGjXKWLPEzK3TJed7cSP34+F3igA4D8km4GhglRWdF541sW2qki092U MdXITmKGiZOJfgPDsZc2OeaDspWrcHBONof3n8277r8/3U5RlQt9eZXK+evSlycmmw v3aC6DtSNKfRzPh/ul0uqKPB8aHX00RpSxIyrLUs= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 6ACC33857C63 for ; Fri, 5 Feb 2021 02:48:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6ACC33857C63 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 1152mHSd003459 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 4 Feb 2021 21:48:22 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 1152mHSd003459 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)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 32EF11E945; Thu, 4 Feb 2021 21:48:17 -0500 (EST) Subject: Re: [PATCH v5 03/25] Add GDB-side remote target support for memory tagging To: Luis Machado , gdb-patches@sourceware.org References: <20210127202112.2485702-1-luis.machado@linaro.org> <20210127202112.2485702-4-luis.machado@linaro.org> Message-ID: Date: Thu, 4 Feb 2021 21:48:16 -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-4-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:48:17 +0000 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: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 2021-01-27 3:20 p.m., Luis Machado via Gdb-patches wrote: > Updates for v4: > > - Rename RSP helper functions. > - Fixup parameter and return types. > > Updates for v2: > > - Add type field to target hooks. > - Add type data to qMemTags and QMemTags. The packets now look like this: > > qMemTags:
,: > QMemTags:
,:: > > -- > > This patch adds memory tagging support to GDB's remote side, with > packet string checks, new packet support and an implementation of > the two new tags methods fetch_atags and store_atags. fetch_memtags and store_memtags > > GDBserver needs to know how to read/write allocation tags, since that is > done via ptrace. It doesn't need to know about logical tags. > > The new packets are: > > qMemTags:
,: > -- > > Reads tags of the specified type from the address range > [
,
) > > QMemTags:
,:: > -- > Writes the tags of specified type represented by the uninterpreted bytes to > the address range [
,
). > > The interpretation of what to do with the tag bytes is up to the arch-specific > code. > > Note that these new packets consider the case of packet size overflow as an > error, given the common use case is to read/write only a few memory tags at > a time. Having to use a couple new packets for multi-part transfers wouldn't > make sense for the little use it would have. > > gdb/ChangeLog: > > YYYY-MM-DD Luis Machado > > * remote.c (PACKET_memory_tagging_feature): New enum. > (remote_memory_tagging_p): New function. > (remote_protocol_features): New "memory-tagging" entry. > (remote_target::remote_query_supported): Handle memory tagging > support. > (remote_target::supports_memory_tagging): Implement. > (create_fetch_memtags_request, parse_fetch_memtags_reply) > (create_store_memtags_request): New functions. > (remote_target::fetch_memtags): Implement. > (remote_target::store_memtags): Implement. > (_initialize_remote): Add new "memory-tagging-feature" > config command. > --- > gdb/remote.c | 106 +++++++++++++++++++++++++++++++++++++++++++++++++-- > 1 file changed, 103 insertions(+), 3 deletions(-) > > diff --git a/gdb/remote.c b/gdb/remote.c > index b130f1ddae..bb3473b04c 100644 > --- a/gdb/remote.c > +++ b/gdb/remote.c > @@ -2175,6 +2175,10 @@ enum { > /* Support TARGET_WAITKIND_NO_RESUMED. */ > PACKET_no_resumed, > > + /* Support for memory tagging, allocation tag fetch/store > + packets and the tag violation stop replies. */ > + PACKET_memory_tagging_feature, > + > PACKET_MAX > }; > > @@ -2316,6 +2320,14 @@ remote_exec_event_p (struct remote_state *rs) > return packet_support (PACKET_exec_event_feature) == PACKET_ENABLE; > } > > +/* Returns true if memory tagging is supported. */ > + > +static bool > +remote_memory_tagging_p (void) Remove `void`. Otherwise, LGTM. Simon