From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id tVZnNR8teWnEnhgAWB0awg (envelope-from ) for ; Tue, 27 Jan 2026 16:24:47 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=QiwRo05i; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id C7ED81E0DD; Tue, 27 Jan 2026 16:24:47 -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 C3B6D1E089 for ; Tue, 27 Jan 2026 16:24:46 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 3BCF64BA2E21 for ; Tue, 27 Jan 2026 21:24:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3BCF64BA2E21 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1769549086; bh=mgGmo/gZgregIDmzcnCvTK9FcoSi0RU4UyX7E8JS5sI=; h=References:In-Reply-To:Date:Subject:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=QiwRo05iOSlvaYpLQ96dCH6OnekzZr6Yvh+G/UaAXU62nfv0tcrYnqBQlWTDRTMxn 4KGHiq66YRqGO49d0AxgH+z9a4s69qfC5PbY4S8naImJIKjMWC9bwb2d6N58FfJgZ6 OWnvJP6Ccc8jnVZLx7JAPRpIO7Lyf2JwsualsBI4= Received: from mail-yw1-x1134.google.com (mail-yw1-x1134.google.com [IPv6:2607:f8b0:4864:20::1134]) by sourceware.org (Postfix) with ESMTPS id 8BE484BA2E36 for ; Tue, 27 Jan 2026 21:24:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8BE484BA2E36 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8BE484BA2E36 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1769549049; cv=pass; b=Dy9Y+WlG1ozhPwq6G3Vaf/MgpNGSKP5NrKQQrglI29OiGvw9uQIuJsWn8q/BDKamlzTLN9vAnVG+q3njWekwY3XVheeFhaRSgRC0u0fgCbIgBSlZ2AqGI1UHnzAt/7s9XIvHvowakmje3dkh/R2vxawbNDaReLctW6fAdS6THto= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1769549049; c=relaxed/simple; bh=92rFjT/imtSXGIWgKQOzi3n6IEY+6mWl8xMA+vw5c+M=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=t3C1wF/LTBxabb0sAjgo/+pE8xlLQP2kxotbGGm4SNDdR6rhL54G/yJzZgx00ETT8cjtDeeFECJBVrgea6djgu5kQuFuxw01kopywMRJaUhZdPJrS7irxltVVZLOmlHA0T3L3AtVODNZJzHW62n/7tCQ5k4Wrwox0s/BTeE/OF0= ARC-Authentication-Results: i=2; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8BE484BA2E36 Received: by mail-yw1-x1134.google.com with SMTP id 00721157ae682-78fb5764382so62115577b3.0 for ; Tue, 27 Jan 2026 13:24:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1769549049; cv=none; d=google.com; s=arc-20240605; b=I/64Pj2A+aOCX/8NM6ds7O3GzXEi/XpVeULU0+GQ+GW/iiN5bO+lFuzCavnANa9HjF Rop7LueaMZs4H0xnjzijNiSqZCzm5yaDK8Nl6ySxhxralO76Gc7kuNVBPjm4I0e+ilDX jgEo/ArAVMLW0rtGOXOR3Cj+q11/XDA/wSQ0QmFbfuAO0onrJdH1bKxiocpDhM03LuU3 ES6Lz3LqeHNqA/Nef+/aKuPGujEcf3yHUxr6lBNEPHR2I/XeffRJff8xw8ifN1soi+p1 UiZf9YvsSsSgqgo6aE22fMgaK+5Uzi0megVU1Wdda9SQlF6OVEYEsUqdKiGAsqz/PcAB Og2Q== 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=mgGmo/gZgregIDmzcnCvTK9FcoSi0RU4UyX7E8JS5sI=; fh=6QI2X1J1bpCKEEPyBCjLASLw1LxOfDsq3L1qLtXhhuw=; b=aP7K3ifzq08PUHVJ0UeaGMIVrFw0B2b+DrMApjl6wPnoX/UyWGaoXwg+OaNMlcC89o zGFCs8Ea85R2zbSAedNaPn9c8cp4yL0SugbuF/9PKh57Z+rPga4L/XUTgbEhSrHUFagM +kyjWKOe8FdQJGSQc1tVvY0g4wfh9EGlFe58O4z7d8JK97nOorLrqwPQ2bjLnYWvWMk6 jXE7Ub3kkRr9+A5S6jYut7nIgNDGy3+08nEeBdcgjVlk4ZikJ06bMfzua9L4AunZH2gx +ulvfMuCk7LuVyhYvIew7r1WF8eUNu3C2xfc5CJqdguAhXC+1OiYWt6tGeZE0RxyU/1Q 7vlA==; darn=sourceware.org ARC-Authentication-Results: i=1; mx.google.com; arc=none X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769549049; x=1770153849; 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=mgGmo/gZgregIDmzcnCvTK9FcoSi0RU4UyX7E8JS5sI=; b=kAa8FkuBHaa6bqTkDj10bwH+vIiQxZwxo9HFW13vXicyHDT7/pFp1rvnzWxGIGx5FI itvLUJKptnVbegiE8l0DCECEfAZWsuecruvwbM3SBZvxl0FzcWMyVkeXhwnP0PidPUFp 3ddlXiX8bT90XiTdNKUDc1ibAe92tYR0735o8LzRzpUttA2c0xLAVPvNlkl+8RsdZETi zFTVO8dQQT8f2Yt5FIpnpj3c3IwwtYnVASw2BS5hg0i7hWDB8K0k9Ay9W4oR+RcbKzX5 KNpLvYdQiGNVGug4Douh1JaZuUu7d+eNrD2BS3unrewXF8qJslKiWgREpH9Uwfeg08e3 y7fA== X-Gm-Message-State: AOJu0YxCLl5i1uihU/L8nhPZaJ6EyDL5u81lnJWZR2PYLlX03voTJ+xb nAa9uclVtlQsZly2f/fxXn4WriB52jMQ0Mj0KqjADrOHyImFfP12zQqkYXtcVMAmPqcpob7wFra fGszDkEkbYgrQcm9bAZVmaVtclHBNeo797Pk1l/hz8+XYvOIgwQ36PZU= X-Gm-Gg: AZuq6aJlRPu3Q4aD/MwpEzzAXwuR1Ikky7q+iOIonp06/CfmCIkwbJD1oghXOvgSPhp nzeG7qCCqlmT6P+QKTVq9koFV3O4KUnsJwrOy8Z+6uqy0GwSqlZe0dC8exsq56yZGCpo+4zADco l7g7kTfAHz1nj8IYzP21+G7n9jWs17TAGea4hWmyItSUXSzmgq8SDRqDpbN66xHONLh4gIUtPXt i6esMEB6dFw1QGPLAvx5mJWEqHe5xxoR2qQIsHfr0VvQvzQtoVquCwnsqAhHUPLo1O/3A== X-Received: by 2002:a05:690c:6287:b0:793:a3c9:795d with SMTP id 00721157ae682-7947ac15f3amr23147477b3.59.1769549048841; Tue, 27 Jan 2026 13:24:08 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 27 Jan 2026 21:23:57 +0000 X-Gm-Features: AZwV_QitOyhB_aPNTLEGWJ3dlzv0LzXsmXsUm4keQ5XvECMdA9RVIr5R39ik6VY Message-ID: Subject: Re: gdb support for SME-without-SVE ? To: gdb@sourceware.org Cc: Manos Pitsidianakis , luis.machado.foss@gmail.com, Thiago Bauermann Content-Type: text/plain; charset="UTF-8" X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Peter Maydell via Gdb Reply-To: Peter Maydell Errors-To: gdb-bounces~public-inbox=simark.ca@sourceware.org Sender: "Gdb" On Tue, 27 Jan 2026 at 11:31, Peter Maydell wrote: > > Hi: is GDB for Arm intended to support configurations where the target > CPU has SME but not SVE? > > We're just implementing support for that in QEMU for using SME > with the hvf hypervisor accelerator on macos systems, but when > we tried connecting gdb to QEMU gdb crashed: > > (gdb) target remote localhost:1234 > Remote debugging using localhost:1234 > ../../gdb/aarch64-tdep.c:3068: internal-error: > aarch64_pseudo_register_type: bad register number 160 > A problem internal to GDB has been detected, > further debugging may prove unreliable. > Fatal signal: Abort trap: 6 > > https://lore.kernel.org/qemu-devel/CAAjaMXZLG2aBtStRhyvmdENj1Z+Mx05BmDgyYUoYrc_ZnHwyVQ@mail.gmail.com/ > > Is this a known missing feature in GDB, or is it a config that's > supposed to work but we've got the XML register description wrong > somehow? Further investigation shows that this happened because QEMU was accidentally reporting the zN vector registers with a width of zero. Does gdb consider "internal error when fed bogus XML" a bug, or just a "don't do that then" situation ? (Obviously we're going to fix QEMU to not do that ;-)) Aside from that, I do have some questions about the GDB remote protocol SVE and SME features where the docs at https://sourceware.org/gdb/current/onlinedocs/gdb.html/AArch64-Features.html are not clear to me, and I hope you can clear up my confusion. (1) In a CPU with both SVE and SME, what does GDB expect org.gnu.gdb.aarch64.sve "vg" to be reported as -- the SVE vector granule, or the current vector granule taking account of both SVE and SME? The docs can be read to support both: https://sourceware.org/gdb/current/onlinedocs/gdb.html/AArch64.html says both that vl/vq/vg "define the size of each Z register" (implying it's the current vector length which might be the SVE vector length or the streaming vector length depending on SVCR.SM) but also "When streaming mode is enabled, the program supports execution of SVE2 instructions and the SVE registers will have vector length svl. When streaming mode is disabled, the SVE registers have vector length vl", implying that vl/vq/vg are purely the SVE vector length and that to get the actual size of the Z register gdb will look at both vq and svq and SVCR.SM. (2) If the CPU has SME and not SVE, presumably we should still expose org.gnu.gdb.aarch64.sve, as it's where the z registers are. What should we report "vl" as here? How about when the CPU is not in streaming mode and the z regs aren't accessible? (3) What does GDB mean when it says about the vector registers z0..z31 in org.gnu.gdb.aarch64.sve that "Their sizes are variable"? As far as I know once the gdbstub has handed you the XML that fixes the size of the registers in it and they can't change afterwards. Does this bit of the docs just mean "the stub will give gdb a register that might be any size" ? Or is gdb going to expect to transfer more or less data when it does a register read/write based on the current value of vg ? (Currently QEMU assumes that it will always get/send enough data to completely fill the worst-case maximum vector reg size it defined in the XML.) My guesses as to plausible answers are: - for an SME-without-SVE CPU, the stub should still report org.gnu.gdb.aarch64.sve as well as org.gnu.gdb.aarch64.sme. - org.gnu.gdb.aarch64.sve 'vg' should be the current length of the vector registers (accounting for both SVE and SME), and 2 when the vector registers aren't accessible (128 bits, per the Arm ARM rule R_KXKNK). - the z regs are variable size in the protocol only in the sense that the stub gets to set the size when it sends the XML, and it sizes them to MAX(sve_max_len, sme_max_len). Register read and write packets then always send and receive that many bytes, even if the current runtime vector length is smaller and the tail of the vector is inaccessible junk. thanks -- PMM