On Mon, 12 Apr 2021 at 10:05, Claudio Fontana <cfont...@suse.de> wrote: > > Hi Peter, > > On 4/8/21 12:36 PM, Peter Maydell wrote: > > On Thu, 8 Apr 2021 at 11:23, Claudio Fontana <cfont...@suse.de> wrote: > >> Mainly for this code here a question from my side: is the current code > >> actually already "wrong"? > >> > >> I mean, we unconditionally set the aarch64-capable cpu classes to all use > >> aarch64_gdb_arch_name and gdbstub64, > >> but what about an aarch64-capable cpu running in 32bit mode? > > > > This is somewhere between a bug and a missing feature. The 'bug' part is > > that for running a guest on AArch64 KVM with -cpu aarch64=off' (ie a > > 32-bit guest) we should be presenting an aarch32 gdb stub, and we don't. > > Isn't this "easily" solvable? Probably I am missing something obvious..
Fairly, yes. That's why I classify it as "bug". It's just nobody's written the patch. > I mean we could dispatch to the one or to the other according to ->is_aa64()? No, because is_aa64() is the "at runtime, is the CPU currently 32-bit or 64 bit?" check. For gdbstub functions, because gdb cannot handle runtime switching, the check should be a static one of the "what kind of CPU is this?" type. (This is effectively what we do today, except that for the special case of "aarch64=off" we make the wrong choice.) thanks -- PMM