From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qv1-xf41.google.com (mail-qv1-xf41.google.com [IPv6:2607:f8b0:4864:20::f41]) by sourceware.org (Postfix) with ESMTPS id BD5BA3840C3C for ; Wed, 15 Jul 2020 19:47:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BD5BA3840C3C Received: by mail-qv1-xf41.google.com with SMTP id a14so1472406qvq.6 for ; Wed, 15 Jul 2020 12:47:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/DyN8jCZ4a8tXxgFW/vCYxxqiLn3Q5EQBK9Ta6amUvM=; b=HS8UhqnAHVQ4DHiv9W6PSl0/9OwD526KZ5N8IoWvkVCah5GJBp6/x3GtTHj8Zsac3d sIcAYdMdvDONAJBPqx2ILmrClsU/S37ymmybRfrc5IoEAf5wQACWJufWOYDR55s/Rs/8 Kj3Epg7M7xftpfDi341v1AjXjvDBDPjU/Auq6CjnY8fn/0mBJE0ceuAK/LLUCD6gsz65 ot1ongJu7STvif46DKD/DA2hzAU6kaL9BW/BJUQTzCiybCqHSp+vu5GDzoWZc2+2KWIa YWxHAubB71ke3ljltP6WeBcyx8K8yXY1lYI2Iu1DAf8HlJ/a/PQ7DF6o/yxEUd9mozP1 2S5w== X-Gm-Message-State: AOAM5319TMQNJlopqpF6C+SxJTtXUHigiBBH2dsiFFo2pdFH2ZkadfeD V7Zihi9grBHlQywrrXZVRmjILwnHVZBg8w== X-Google-Smtp-Source: ABdhPJxX1C5c7VrHmfcqZxlxugdD4GTHW/YufBtX1IKtpvWup5OQC8Ma/iO0XsJMB6uB5bKB0y3aiA== X-Received: by 2002:a0c:83e6:: with SMTP id k93mr944999qva.112.1594842440037; Wed, 15 Jul 2020 12:47:20 -0700 (PDT) Received: from localhost.localdomain ([2804:7f0:8283:82c3:9daa:7611:ebe6:931]) by smtp.gmail.com with ESMTPSA id z18sm4340537qta.51.2020.07.15.12.47.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2020 12:47:19 -0700 (PDT) From: Luis Machado To: gdb-patches@sourceware.org, Alan.Hayward@arm.com Cc: omair.javaid@linaro.org, catalin.marinas@arm.com, david.spickett@linaro.org, jose.marchesi@oracle.com Subject: [PATCH 07/23] Documentation for memory tagging remote packets Date: Wed, 15 Jul 2020 16:44:57 -0300 Message-Id: <20200715194513.16641-8-luis.machado@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200715194513.16641-1-luis.machado@linaro.org> References: <20200715194513.16641-1-luis.machado@linaro.org> 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, RCVD_IN_DNSWL_NONE, 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: Wed, 15 Jul 2020 19:47:22 -0000 Document the remote packet changes to support memory tagging. gdb/doc/ChangeLog: YYYY-MM-DD Luis Machado * gdb.texinfo (General Query Packets): Document qMemTags and QMemTags. Document the "memory-tagging" feature. --- gdb/doc/gdb.texinfo | 84 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index a002084d5b..bc610e44cd 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -40654,6 +40654,77 @@ is a sequence of thread IDs, @var{threadid} (eight hex digits), from the target. See @code{remote.c:parse_threadlist_response()}. @end table +@item qMemTags:@var{start address}:@var{length} +@cindex fetch memory tags +@cindex @samp{qMemTags} packet +Fetch memory tags in the address range @r{[}@var{start address}, +@var{start address} + @var{length}@r{)}. The target is responsible for +calculating how many tags will be returned, as this is architecture-specific. + +@var{start address} is the starting address of the memory range. + +@var{length} is the length, in bytes, of the memory range. + +Reply: +@table @samp +@item @var{mXX}@dots{} +Hex encoded sequence of uninterpreted bytes representing the tags found in +the request memory range. + +@item E @var{nn} +An error occured. This means that fetching of memory tags failed for some +reason. + +@item @w{} +An empty reply indicates that @samp{qMemTags} is not supported by the stub, +although this should not happen given @value{GDBN} will only send this packet +if the stub has advertised support for memory tagging via @samp{qSupported}. +@end table + +@item QMemTags:@var{start address}:@var{length}:@var{tag bytes} +@cindex store memory tags +@cindex @samp{QMemTags} packet +Store memory tags to the address range @r{[}@var{start address}, +@var{start address} + @var{length}@r{)}. The target is responsible for +interpreting the tag bytes and modifying the memory tag granules +accordingly, given this is architecture-specific. + +The interpretation of how many tags should be written to how many memory tag +granules is also architecture-specific. The behavior is +implementation-specific, but the following is suggested. + +If the number of memory tags, @var{N}, is greater than or equal to the number +of memory tag granules, @var{G}, only @var{G} tags will be stored. + +If @var{N} is less than @var{G}, the behavior is that of a fill operation, +and the tag bytes will be used as a pattern that will get repeated until +@var{G} tags are stored. + +@var{start address} is the starting address of the memory range. The address +does not have any restriction on alignment or size. + +@var{length} is the length, in bytes, of the memory range. + +@var{tag bytes} is a sequence of hex encoded uninterpreted bytes which will be +interpreted by the target. Each pair of hex digits is interpreted as a +single byte. + +Reply: +@table @samp +@item OK +The request was successful and the memory tag granules were modified +accordingly. + +@item E @var{nn} +An error occured. This means that modifying the memory tag granules failed +for some reason. + +@item @w{} +An empty reply indicates that @samp{QMemTags} is not supported by the stub, +although this should not happen given @value{GDBN} will only send this packet +if the stub has advertised support for memory tagging via @samp{qSupported}. +@end table + @item qOffsets @cindex section offsets, remote request @cindex @samp{qOffsets} packet @@ -41321,6 +41392,11 @@ These are the currently defined stub features and their properties: @tab @samp{-} @tab No +@item @samp{memory-tagging} +@tab No +@tab @samp{-} +@tab No + @end multitable These are the currently defined stub features, in more detail: @@ -41535,6 +41611,14 @@ The remote stub understands the @samp{QThreadEvents} packet. @item no-resumed The remote stub reports the @samp{N} stop reply. +@item memory-tagging +The remote stub supports and implements the required memory tagging +functionality and understands the @samp{qMemTags} and @samp{QMemTags} packets. + +For AArch64 GNU/Linux systems, this feature also requires access to the smaps +file in the proc filesystem so memory mapping page flags can be inspected. This +is done via the @samp{vFile} requests. + @end table @item qSymbol:: -- 2.17.1