Return-Path: Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id ba16-20020a0560001c1000b0033b2799815csm3561519wrb.86.2024.02.23.08.24.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 08:24:18 -0800 (PST) Received: from draig (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 80FBD5F781; Fri, 23 Feb 2024 16:24:18 +0000 (GMT) From: =?utf-8?Q?Alex_Benn=C3=A9e?= To: Akihiko Odaki Cc: qemu-devel@nongnu.org, Yoshinori Sato , David Hildenbrand , Weiwei Li , Richard Henderson , Michael Rolnik , Ilya Leoshkevich , Peter Maydell , qemu-ppc@nongnu.org, Paolo Bonzini , qemu-riscv@nongnu.org, Cleber Rosa , Thomas Huth , Song Gao , qemu-arm@nongnu.org, Pierrick Bouvier , John Snow , =?utf-8?Q?C=C3=A9dric?= Le Goater , Nicholas Piggin , qemu-s390x@nongnu.org, Laurent Vivier , "Edgar E. Iglesias" , Daniel Henrique Barboza , Yanan Wang , Palmer Dabbelt , Marcel Apfelbaum , Brian Cain , Mahmoud Mandour , Alexandre Iooss , Bin Meng , Philippe =?utf-8?Q?Mathieu-Daud?= =?utf-8?Q?=C3=A9?= , Daniel Henrique Barboza , Eduardo Habkost , Alistair Francis , Liu Zhiwei Subject: Re: [PATCH 18/23] plugins: add an API to read registers In-Reply-To: <87jzmv8kwx.fsf@draig.linaro.org> ("Alex =?utf-8?Q?Benn=C3=A9?= =?utf-8?Q?e=22's?= message of "Fri, 23 Feb 2024 11:44:30 +0000") References: <20240216163025.424857-1-alex.bennee@linaro.org> <20240216163025.424857-19-alex.bennee@linaro.org> <87il2jcje8.fsf@draig.linaro.org> <87bk8ab0f4.fsf@draig.linaro.org> <87zfvtaoqq.fsf@draig.linaro.org> <7e4b4ba6-3683-464f-ac37-3b7f19455643@daynix.com> <87cysoajhl.fsf@draig.linaro.org> <87plwo8l56.fsf@draig.linaro.org> <308de8f7-5871-4d3d-847c-f4f55fb6f790@daynix.com> <87jzmv8kwx.fsf@draig.linaro.org> User-Agent: mu4e 1.11.28; emacs 29.1 Date: Fri, 23 Feb 2024 16:24:18 +0000 Message-ID: <878r3b87yl.fsf@draig.linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-TUID: mZbrbDC2bu6L Alex Benn=C3=A9e writes: > Akihiko Odaki writes: >>> What about if I just key based of gdb_regnum and we accept that that >>> might break the one heterogeneous system we model today? >>>=20 >> >> That's the best option in my opinion. gdbstub won't work well with >> such a system anyway, and fixing it will need something similar to >> GHashTable. But if I would fix gdbstub for a heterogeneous system, I >> would add a field to CPUClass instead of having a GHashTable keyed >> with tuples of CPUClass pointers and register numbers. It should be >> fine considering that CPUState already has gdbstub-specific fields >> like gdb_regs. > > It would be nice to move all register code into CPUClass to avoid > repeating ourselves but I suspect that is quite an invasive change for a > later series. Currently all the CPUClass values are set on init and > shouldn't really be changed after that otherwise we'll have to start > messing with locking. Peter pointed out we can see different register sets for the same CPUClass but with different features enabled which kills that idea. I've just sent v2 which re-factors the plugin data a little and stores a per CPUPluginState hash table. --=20 Alex Benn=C3=A9e Virtualisation Tech Lead @ Linaro