gdbstub XML generation for ARM is done for every CPU

Host environment

  • QEMU flavor: qemu linux-user
  • QEMU version: version 7.0.50 (v7.0.0-1706-geee6aacd15-dirty)
  • QEMU command line:
    valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes ./qemu-aarch64 ./tests/tcg/aarch64-linux-user/threadcount 100 2> 100thread.out

Emulated/Virtualized environment

  • Architecture: aarch64 (and probably ARM)

Description of problem

  • As arm_cpu_register_gdb_regs_for_features is called from the device realize stage for each vCPU in user mode we end up uselessly regenerating the XML for every new thread. Once you get up to 100 threads this starts exceeding the large maps done for QHT and PageDesc

Steps to reproduce

See above command line, valgrind picks it up

Additional information

See also #866 (closed), #967 (closed)