From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id aQcFLNV7fGk8Tx0AWB0awg (envelope-from ) for ; Fri, 30 Jan 2026 04:37:25 -0500 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=TNFlEhT7; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 9D4631E0DD; Fri, 30 Jan 2026 04:37:25 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 904911E08D for ; Fri, 30 Jan 2026 04:37:24 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 0709E4BA9027 for ; Fri, 30 Jan 2026 09:37:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0709E4BA9027 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=TNFlEhT7 Received: from mail-yw1-x1136.google.com (mail-yw1-x1136.google.com [IPv6:2607:f8b0:4864:20::1136]) by sourceware.org (Postfix) with ESMTPS id 4D5374BA2E32 for ; Fri, 30 Jan 2026 09:36:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4D5374BA2E32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4D5374BA2E32 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2607:f8b0:4864:20::1136 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1769765817; cv=pass; b=yBMdvfZN0PzWTsJylwmVZoDq8ENGs0a4wYYX3aO9bpH9Npv6SVtUhUb07zLBXTWIpkjKLV75YqoBAKaCRL6IsvU4yV9saDHjj6hoWvom+yjy3R+YLg/nfvl4jigijNCPJZFXPDMYKDOlWYYZ8X/FRH0xMb4v9iTjAqvEXGejamI= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1769765817; c=relaxed/simple; bh=zUTt3MhjyUVReYMszklnrRcTNxmU7JxTN1ruwfa3i8I=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=uKGHISSAfeiihtj9/xFQEQlhbRee4ShVSXURWeeH7Kg7WPfq0aq6U/xOD+kuGhmthPMNOK4qP18sDqxt7DyGMp12oe0Y+vEfJ0iMPifzB2QFfa+YjcWfNsgi155G5ZpYLXd0qbx+yEeaVOldSM9eK1ENC4PJf1QDHsnWdAc8GE0= ARC-Authentication-Results: i=2; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4D5374BA2E32 Received: by mail-yw1-x1136.google.com with SMTP id 00721157ae682-7942b9663f8so17987797b3.2 for ; Fri, 30 Jan 2026 01:36:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1769765816; cv=none; d=google.com; s=arc-20240605; b=BSrgkia8H/v/P/k4kqWPcP4tSwLkgQvXOuoHnW+KYshpUBh7mxdf537PWWuW4fuxa1 XTOPn7i0hBosh1b8B6pc+pon1Bs4utQyUnRjilYDUJYZ6KBlPOqO9Ja5lunBRMjLTNc0 tGXarupfVBjPSr7B5MWBDt7ewZ/Op2nJrB1NTJrJR5uMYJVVDisptBIjULjFj0kozTFc rtZLdFi80530kAyOJjhW/z+ltahshTnT0AEJLyfHGxaK9tpliqhqQ26cnQ1rzHJzBYKc K4odNGxiwDBUhh6cBHabgIgbNuoJUOPFYaZiHLDUMheAylggv0dW6Ko3G/7O/KN+6P0a zF+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=GYa3H2tsYJQjiWr7h3ggBqGz/qBY+Fpq+CiUPatbFuU=; fh=IbnlJmMARMsicHKe8AhDmIyoH4xi04g8H/HrmWB6vJA=; b=ZaxTP5kTMl5+p0S7F0RTj3yGjD1n9hklFWEJZiiAU5yqSpCz/B5E/ZNGnBiW4hqPWZ f0fEqj5lTIkw2C4tR0LAXtOXM6IPcOA5p6wxFVvBvfexObxUFDAFmX9u9aW0shwEkDzg 9IGmxOA0cIZxF7iT/l3Q9t16xcrS8OIF+ERap6LJAwm9noASIfY0DtPM1G0iHHK8PTzD 1GiUbs2N+Pb6qqVIChl8oGxiV1veLdR86FfVpR7DwQLX+IF8iMzvNC/WE8HnbAYRU8kM VV38tlbCNxtseN05BTpuVpWL+aNQtrvGyjh2ouwQhA3jO3LLsD4rrkAVl9l3m30AsKgm zcKA==; darn=sourceware.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769765816; x=1770370616; darn=sourceware.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=GYa3H2tsYJQjiWr7h3ggBqGz/qBY+Fpq+CiUPatbFuU=; b=TNFlEhT7UPn5769W6vVyxTZTcFZGOppllh/TghTTEs43HzgJiLqMHHSID/d/D0zhb/ 7CjP/mUmUnHfz3zAk0YNyw1QA+bpEpI53ohHMWzmOl59am2Yd2Xn1m01aOOZ1XPTq/qj 59eKRhOty62D+RC3S9Z7lSNBt9g/l3TSYsbttANF+d9logYJu27zgqclB/krNDiEOAIp cKDqq+9L+NCfSKC/U4+5hB9YitJ4g1uGkKtSYrux8czuc7wQ+aSBwdtWfgViw5CIl+2R +I642h9fk/SfMUj95tglXGoP3YisgrAlcQlmI0apZFAvQC4p7w8dPsVOYbMZHzM+P4+w tGoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769765816; x=1770370616; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=GYa3H2tsYJQjiWr7h3ggBqGz/qBY+Fpq+CiUPatbFuU=; b=NAzOVLHUP99jofY2f3vpT1iwd2dhU9koMatYePHrdo8zF4VY4ez6TMIa+a5l15s5Xc 7sc5HVBlNRV0NL75Az8qjNq024AjRU7WNp3+TcXpMaQDeULYZjfCK2B4x1xvF3r4ScB2 G6+Cq6vksCDO8IdbBRW/YfpaircLEUtVzOZgG0A45klN5nVfmBMrrUaS+UwB19j56Grt U+LI10ljpZNJz2pHbryOh+gyZ2wXFFsbAalOS6OssB08pcNqpO3Iua6oumdk7UwXU7vp i6dGcDaj92xlahYjD6AG/dGWSQQNAdfpB05DBl5Vc83rq3xEWEJEa1t6ND5MmuKFyx/i V6Eg== X-Gm-Message-State: AOJu0Yzm352dxhhczD6ATGpEVkUXoPPbN6qkEw/Bz7g1L0lU+rgz+n6z iHi2T7/jJiPU+laYqxMQPZtKFmKIGegb60zYklZU/YZcpA/u3hCDKgmZonc/YJ21UsIwFeyUFjN 9NlefKw9/yP8NtKtstTNSzcpMsEM8Fw3ymCZAxOzS0g== X-Gm-Gg: AZuq6aJnPajuGfhCywZphVaH7obTmQ5l3eA9NFKQ++OeX+D6XV4OjNNFKkCHQcrIZ+U gSpdVoJOnWfvAQTWo2xG+drEW6TUmm39qUyxLSoZdnfLzipNmrzOoEkSWxtO/sJSjGZe1uG9+R6 zAUvhTJps1ytRoqEGIYcwJVbI9qkaOFMrb8PLHY9ZGw2Ofyt1btkZVjdSaMa2lpTM8qag/TmJ80 pxcNwmG5wDrop3cBdt310m4R/wBwcDn9BoamdhMH83NImEUnHvxLLmVjeRwNThacUBleA== X-Received: by 2002:a05:690c:91:b0:794:7072:b30e with SMTP id 00721157ae682-7949e00829dmr21369757b3.50.1769765816489; Fri, 30 Jan 2026 01:36:56 -0800 (PST) MIME-Version: 1.0 References: <20260129181122.1426596-1-peter.maydell@linaro.org> In-Reply-To: From: Peter Maydell Date: Fri, 30 Jan 2026 09:36:44 +0000 X-Gm-Features: AZwV_QjyxYJCjeeptHZNquHHkraXeb4GslbqmKgKP3UsqQDh7NO6OCPjv6ho7sw Message-ID: Subject: Re: [PATCH] docs: Clarify gdb remote protocol AArch64 SVE and SME handling To: Luis Cc: gdb-patches@sourceware.org, Thiago Jung Bauermann , Manos Pitsidianakis Content-Type: text/plain; charset="UTF-8" X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On Thu, 29 Jan 2026 at 23:18, Luis wrote: > > On Thu, Jan 29, 2026, 18:11 Peter Maydell wrote: >> >> The documentation of the AArch64 target features for the gdb remote >> protocol has some areas where it is unclear about SVE and SME: >> >> * it doesn't say what to do if the target has only SME >> >> * it isn't clear about what the org.gnu.gdb.aarch64.sve vector >> register size should be when both SME and SVE are present >> >> Clarify/correct the documentation: >> >> * org.gnu.gdb.aarch64.sve is effectively "the feature for the z >> vector registers", and must be provided even when the target only >> implements SME (because the z registers exist in an SME only CPU) >> >> * the z register size and the 'vg' pseudoregister in >> org.gnu.gdb.aarch64.sve follow the architectural "effective SVE >> vector length", which might be either the non-streaming SVE vector >> length or the streaming SVE vector length >> >> Reviewed-by: Thiago Jung Bauermann >> --- >> gdb/doc/gdb.texinfo | 18 +++++++++++++++++- >> 1 file changed, 17 insertions(+), 1 deletion(-) >> >> diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo >> index 80f49e21b7e..711a45435ef 100644 >> --- a/gdb/doc/gdb.texinfo >> +++ b/gdb/doc/gdb.texinfo >> @@ -49742,7 +49742,8 @@ Extra registers are allowed in this feature, but they will not affect >> @subsubsection AArch64 SVE registers feature >> >> The @samp{org.gnu.gdb.aarch64.sve} feature is optional. If present, >> -it means the target supports the Scalable Vector Extension and must contain >> +it means the target supports either the Scalable Vector Extension (SVE) or >> +the Scalable Matrix Extension (SME) and must contain >> the following registers: >> >> @itemize @minus >> @@ -49780,6 +49781,14 @@ vector registers from the @samp{org.gnu.gdb.aarch64.fpu} feature. >> The first 128 bits of the @samp{z} registers overlap the 128 bits of the >> @samp{v} registers, so changing one will trigger a change to the other. >> >> +@samp{vg} represents the size of the @samp{z} registers, and is what >> +the Arm architecture defines as the ``Effective SVE vector length''. That >> +means that if the target implements SME and is in streaming vector mode, >> +it is the streaming vector length. If the target implements only SME and >> +not SVE, and is not in streaming vector mode, then @samp{vg} is 2 >> +(indicating 128-bit vectors) and the @samp{z} registers match the @samp{v} >> +FPU registers. >> + >> For the types of the @samp{z}, @samp{p} and @samp{ffr} registers, please >> check the aarch64-sve.c file. No XML file is available for this feature >> because it is dynamically generated based on the current vector length. >> @@ -49793,6 +49802,9 @@ aarch64-sve.c file, and should match what is described in aarch64-fpu.xml. >> Extra registers are allowed in this feature, but they will not affect >> @value{GDBN}. >> >> +The @samp{org.gnu.gdb.aarch64.sve} feature is required when the target also >> +reports support for the @samp{org.gnu.gdb.aarch64.sme} feature. >> + >> @subsubsection AArch64 Pointer Authentication registers feature >> >> The @samp{org.gnu.gdb.aarch64.pauth} optional feature was introduced so >> @@ -49948,6 +49960,10 @@ extensions of the architecture. >> Extra registers are allowed in this feature, but they will not affect >> @value{GDBN}. >> >> +Note that a target with only SME but not SVE support must still >> +provide the @samp{org.gnu.gdb.aarch64.sve} feature, to expose the >> +@samp{z} vector registers. >> + >> The @samp{org.gnu.gdb.aarch64.sme} feature is required when the target also >> reports support for the @samp{org.gnu.gdb.aarch64.sme2} feature. >> >> -- >> 2.43.0 > > > Thanks. The documentation update looks OK given the current needs, but I'm not too sure about keeping the SVE feature just for the Z registers. I find that a bit confusing. When I said "for the Z registers" that was a perhaps confusing simplification. SME's "streaming SVE" mode still requires all of: - the z regs - the p predicate regs - the ffr register - fpsr - fpcr (because streaming SVE gives you a subset of the SVE2 instruction set). The only thing that becomes in some sense duplicated is that the 'vg' pseudoregister in org.gnu.gdb.aarch64.sve will always read the same as the 'svg' pseudoregister in org.gnu.gdb.aarch64.sme, because the Z reg size is always the same as the ZA array size. But the debugger doesn't really need to care about that, as long as it consistently uses org.gnu.gdb.aarch64.sve 'vg' for the Z reg length and org.gnu.gdb.aarch64.sme 'svg' for the ZA array size (which it must do already for the SVE + SME case). > It might be cleaner to clearly separate SVE and SME features, adding > Z registers to a SME feature if needed when SVE is disabled. Or > something similar to that. The disadvantage here is that instead of "SME only remote debug just works with the existing gdb" we get "you will need a new gdb that understands the new features". > I don't feel comfortable setting this is stone before we have a > patch that clarifies how this separation between SVE and SME is > achieved. I agree that we don't want to commit this until we're happy that it's the right thing. This patch is my attempt to put down in a concrete form how I think this should work. When you talk about "a patch that clarifies how this separation between SVE and SME is achieved", what do you mean? A patch to gdb? With this proposal, current gdb I think should work without changes. The changes Thiago has are all because of the way that the Linux ptrace API has chosen to represent SVE and SME, AIUI. thanks -- PMM