From: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
To: "Willgerodt, Felix" <felix.willgerodt@intel.com>
Cc: Luis Machado <luis.machado@arm.com>,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PATCH v3 0/8] gdbserver improvements for AArch64 SVE support
Date: Tue, 10 Sep 2024 02:36:19 -0300 [thread overview]
Message-ID: <878qw0oyss.fsf@linaro.org> (raw)
In-Reply-To: <MN2PR11MB45662ED826EFC2C57BE029E48EE72@MN2PR11MB4566.namprd11.prod.outlook.com> (Felix Willgerodt's message of "Fri, 10 May 2024 13:47:11 +0000")
I'm finally reviving this work, and will have a talk about it at GNU
Tools Cauldron next Monday. If you are going to be there, we can discuss
in person.
"Willgerodt, Felix" <felix.willgerodt@intel.com> writes:
>> -----Original Message-----
>> From: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
>>
>> Thank you for your interest in this series! I think it's very important
>> too, and it nags me that I haven't been able to finish it yet. I gave up
>> on the approach from this patch series, which was to have a different
>> target description for each register size, which implies a different
>> target description for each inferior thread.
>>
>> I have a branch where I implemented support in the XML target
>> description to specify a register whose size is given by a math
>> expression involving other registers. This way, a single target
>> description is enough for the whole duration of the inferior execution,
>> and for all inferior threads. But it still has significant bugs, and
>> only occasionally I have been able to get back to it and try to move it
>> forward. I pushed what I have to the sve-tdesc-dynamic-size branch at
>> this repo, if you would like to have a look:
>>
>> https://git.linaro.org/people/thiago.bauermann/binutils-gdb.git
>>
>> If you "git diff 1bdabb9e9fe8..<remote>/sve-tdesc-dynamic-size" you can
>> see the code.
>>
>> I think I will be able to work on it again in a month or two. If you
>> think my approach is good and the branch is a good starting point for
>> you, feel free to work on it. I'd be happy to collaborate.
>>
>
> Thanks for the clarification.
> I briefly looked at your branch, but I didn't have enough time to really
> understand it yet. But I still wanted to give some feedback based on
> my current knowledge and what you wrote.
Thank you!
> On x86 we will also need resizable registers. Though on x86, the
> sizing information is only partially found in other registers. Some of
> the sizing information comes e.g. from the CPUID instruction
> (basically an instruction to query features of your CPU, no idea if
> there is an ARM equivalent).
I think this won't be a problem with my current approach. The basic idea
is to encode a simple math expression in the description XML (using
MathML notation). A register value will be referenced with a <ci>
element, which specifies a variable.
You could define a variable name to mean the information from the CPUID
instruction or some other source.
> And x86 would also need the full
> flexibility of adding or removing registers I think. So would the
> Intel GPU port, that is currently still a downstream fork.
I don't address the possibility of adding or removing registers.
I believe my approach doesn't make it easier nor harder to add support
for it though.
> I realize that this is mainly our problem. We will start working on
> This eventually. Though I think any series touching generic code
> should offer enough flexibility for all architectures. I wonder
> if your new approach offers that (I actually don't know),
> if it is only based on other registers and only offers resizing.
I think my new approach adds flexibility in the sense that it allows for
a new way to specify register sizes that is very flexible (simple math
expressions using the contents of other registers, or even other kinds
of information) while not getting in the way of additional approaches
that may be added in the future, including the previous approach of
per-thread target descriptions.
> Though if it doesn't prevent adding additional input for re-sizing
> and could live in parallel to adding/removing registers at runtime
> it could be viewed as ok.
Yes, I believe that is the case. I think it makes easier to add
additional input for resizing, by way of new variables which can be used
in math expressions that represent those inputs. And it could live in
parallel to adding/removing registers at runtime.
> But it makes me wonder a bit if the older approach isn't more
> flexible for future architectures that want to use it. And it also
> seems to be closer to the way GDB has already implemented.
> Of course that doesn't mean we can't switch GDB to
> a better solution at some point.
>
> So I am curious: What was your reason for switching to the
> new approach?
I think Pedro summed up well the main concerns with the per-thread
target description approach for the case of SVE support:
https://inbox.sourceware.org/gdb-patches/045c1e09-5b6d-22b6-df7a-39cfa339b0e1@palves.net/
I agree with him that conceptually SVE would be best modelled in GDB as
a target description feature specifying variable-sized registers. It
isn't like that in the way GDB is currently implemented (and also in
this patch series we're replying to) because of practical concerns with
the complexity of the ideal solution.
There was also concern about adding RSP support for it if it's not the
best approach, because when adding a new feature to the remote protocol
it's not easy to change or drop support for it later.
I had researched into how to implement this new approach before posting
the first version of this patch series, but at the time I wasn't able to
find a way in a reasonable amount of time. After this feedback, I
decided to try again and this time I was able to find a way to implement
it.
That doesn't mean that per-thread target description aren't the best
model for other situations. For instance, if a system has different
processor models in a single core then it is the natural approach.
Also, if in your case registers can be added or removed, maybe it's the
best approach as well.
--
Thiago
prev parent reply other threads:[~2024-09-10 5:36 UTC|newest]
Thread overview: 99+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-30 4:45 Thiago Jung Bauermann via Gdb-patches
2023-01-30 4:45 ` [PATCH v3 1/8] gdbserver: Add assert in find_register_by_number Thiago Jung Bauermann via Gdb-patches
2023-01-31 17:05 ` Simon Marchi via Gdb-patches
2023-01-31 19:49 ` Thiago Jung Bauermann via Gdb-patches
2023-02-01 15:43 ` Simon Marchi via Gdb-patches
2023-01-30 4:45 ` [PATCH v3 2/8] gdbserver: Add PID parameter to linux_get_auxv and linux_get_hwcap Thiago Jung Bauermann via Gdb-patches
2023-02-01 9:07 ` Luis Machado via Gdb-patches
2023-02-01 10:54 ` Andrew Burgess via Gdb-patches
2023-02-01 16:01 ` Simon Marchi via Gdb-patches
2023-02-01 19:33 ` Thiago Jung Bauermann via Gdb-patches
2023-02-01 19:53 ` Simon Marchi via Gdb-patches
2023-02-01 21:55 ` Thiago Jung Bauermann via Gdb-patches
2023-02-06 19:54 ` Pedro Alves
2023-02-06 20:16 ` Simon Marchi via Gdb-patches
2023-02-07 15:19 ` Pedro Alves
2023-02-07 21:47 ` Thiago Jung Bauermann via Gdb-patches
2023-02-09 1:31 ` Simon Marchi via Gdb-patches
2023-02-10 3:54 ` Thiago Jung Bauermann via Gdb-patches
2023-02-07 22:28 ` Thiago Jung Bauermann via Gdb-patches
2023-01-30 4:45 ` [PATCH v3 3/8] gdbserver/linux-aarch64: Factor out function to get aarch64_features Thiago Jung Bauermann via Gdb-patches
2023-02-01 8:59 ` Luis Machado via Gdb-patches
2023-02-01 16:04 ` Simon Marchi via Gdb-patches
2023-02-01 22:13 ` Thiago Jung Bauermann via Gdb-patches
2023-01-30 4:45 ` [PATCH v3 4/8] gdbserver/linux-aarch64: When thread stops, update its target description Thiago Jung Bauermann via Gdb-patches
2023-02-01 9:05 ` Luis Machado via Gdb-patches
2023-02-01 11:06 ` Andrew Burgess via Gdb-patches
2023-02-01 16:21 ` Simon Marchi via Gdb-patches
2023-02-01 16:32 ` Luis Machado via Gdb-patches
2023-02-02 2:54 ` Thiago Jung Bauermann via Gdb-patches
2023-02-02 3:47 ` Simon Marchi via Gdb-patches
2023-02-03 3:47 ` Thiago Jung Bauermann via Gdb-patches
2023-02-03 11:13 ` Luis Machado via Gdb-patches
2023-02-04 15:26 ` Thiago Jung Bauermann via Gdb-patches
2023-02-03 11:11 ` Luis Machado via Gdb-patches
2023-02-04 15:21 ` Thiago Jung Bauermann via Gdb-patches
2023-02-06 9:07 ` Luis Machado via Gdb-patches
2023-02-06 12:15 ` Thiago Jung Bauermann via Gdb-patches
2023-02-06 20:29 ` Pedro Alves
2023-02-07 8:11 ` Luis Machado via Gdb-patches
2023-02-07 14:39 ` Thiago Jung Bauermann via Gdb-patches
2023-02-03 10:57 ` Luis Machado via Gdb-patches
2023-02-04 6:18 ` Thiago Jung Bauermann via Gdb-patches
2023-02-06 20:26 ` Pedro Alves
2023-02-07 21:06 ` Thiago Jung Bauermann via Gdb-patches
2023-02-09 2:46 ` Simon Marchi via Gdb-patches
2023-02-10 3:29 ` Thiago Jung Bauermann via Gdb-patches
2023-02-10 14:56 ` Luis Machado via Gdb-patches
2023-02-10 15:04 ` Tom Tromey
2023-02-10 15:28 ` Luis Machado via Gdb-patches
2023-02-10 17:26 ` Thiago Jung Bauermann via Gdb-patches
2023-02-10 21:01 ` Simon Marchi via Gdb-patches
2023-01-30 4:45 ` [PATCH v3 5/8] gdbserver: Transmit target description ID in thread list and stop reply Thiago Jung Bauermann via Gdb-patches
2023-01-30 12:52 ` Eli Zaretskii via Gdb-patches
2023-01-30 14:05 ` Thiago Jung Bauermann via Gdb-patches
2023-02-01 9:39 ` Luis Machado via Gdb-patches
2023-02-01 12:07 ` Andrew Burgess via Gdb-patches
2023-02-01 13:03 ` Eli Zaretskii via Gdb-patches
2023-02-01 17:37 ` Simon Marchi via Gdb-patches
2023-02-02 20:36 ` Thiago Jung Bauermann via Gdb-patches
2023-02-02 20:56 ` Simon Marchi via Gdb-patches
2023-02-01 20:46 ` Simon Marchi via Gdb-patches
2023-02-02 21:43 ` Thiago Jung Bauermann via Gdb-patches
2023-02-01 14:51 ` Andrew Burgess via Gdb-patches
2023-02-01 17:03 ` Simon Marchi via Gdb-patches
2023-02-02 19:52 ` Thiago Jung Bauermann via Gdb-patches
2023-02-02 20:51 ` Simon Marchi via Gdb-patches
2023-02-03 2:44 ` Thiago Jung Bauermann via Gdb-patches
2023-02-03 16:29 ` Andrew Burgess via Gdb-patches
2023-02-04 6:08 ` Thiago Jung Bauermann via Gdb-patches
2023-02-03 11:22 ` Luis Machado via Gdb-patches
2023-02-03 12:50 ` Simon Marchi via Gdb-patches
2023-01-30 4:45 ` [PATCH v3 6/8] gdb/remote: Parse tdesc field in stop reply and threads list XML Thiago Jung Bauermann via Gdb-patches
2023-02-01 9:52 ` Luis Machado via Gdb-patches
2023-02-05 0:06 ` Thiago Jung Bauermann via Gdb-patches
2023-02-06 9:10 ` Luis Machado via Gdb-patches
2023-02-01 14:32 ` Andrew Burgess via Gdb-patches
2023-02-01 19:50 ` Simon Marchi via Gdb-patches
2023-02-01 20:16 ` Simon Marchi via Gdb-patches
2023-02-03 11:27 ` Luis Machado via Gdb-patches
2023-02-03 13:19 ` Simon Marchi via Gdb-patches
2023-02-03 16:33 ` Andrew Burgess via Gdb-patches
2023-01-30 4:45 ` [PATCH v3 7/8] gdb/aarch64: Detect vector length changes when debugging remotely Thiago Jung Bauermann via Gdb-patches
2023-02-01 9:58 ` Luis Machado via Gdb-patches
2023-02-01 15:26 ` Andrew Burgess via Gdb-patches
2023-02-01 20:20 ` Simon Marchi via Gdb-patches
2023-02-03 11:31 ` Luis Machado via Gdb-patches
2023-02-03 16:38 ` Andrew Burgess via Gdb-patches
2023-02-03 19:07 ` Simon Marchi via Gdb-patches
2023-01-30 4:45 ` [PATCH v3 8/8] gdb/testsuite: Add test to exercise multi-threaded AArch64 SVE inferiors Thiago Jung Bauermann via Gdb-patches
2023-02-01 10:10 ` Luis Machado via Gdb-patches
2023-02-06 19:11 ` [PATCH v3 0/8] gdbserver improvements for AArch64 SVE support Pedro Alves
2023-02-06 20:05 ` Simon Marchi via Gdb-patches
2023-02-06 21:06 ` Pedro Alves
2023-02-07 13:49 ` Simon Marchi via Gdb-patches
2024-05-07 14:29 ` Willgerodt, Felix
2024-05-07 14:43 ` Luis Machado
2024-05-07 16:34 ` Thiago Jung Bauermann
2024-05-10 13:47 ` Willgerodt, Felix
2024-09-10 5:36 ` Thiago Jung Bauermann [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878qw0oyss.fsf@linaro.org \
--to=thiago.bauermann@linaro.org \
--cc=felix.willgerodt@intel.com \
--cc=gdb-patches@sourceware.org \
--cc=luis.machado@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox