qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/10] Deprecate/rename singlestep command line option, monitor interfaces
@ 2023-04-03 14:46 Peter Maydell
  2023-04-03 14:46 ` [PATCH v2 01/10] make one-insn-per-tb an accel option Peter Maydell
                   ` (10 more replies)
  0 siblings, 11 replies; 35+ messages in thread
From: Peter Maydell @ 2023-04-03 14:46 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, Warner Losh, Kyle Evans, libvir-list,
	Markus Armbruster, Dr. David Alan Gilbert, Laurent Vivier,
	Eric Blake

The command line option '-singlestep' and its HMP equivalent
the 'singlestep' command are very confusingly named, because
they have nothing to do with single-stepping the guest (either
via the gdb stub or by emulation of guest CPU architectural
debug facilities). What they actually do is put TCG into a
mode where it puts only one guest instruction into each
translation block. This is useful for some circumstances
such as when you want the -d debug logging to be easier to
interpret, or if you have a finicky guest binary that wants
to see interrupts delivered at something other than the end
of a basic block.

The confusing name is made worse by the fact that our
documentation for these is so minimal as to be useless
for telling users what they really do.

This series:
 * changes the command line interface: for user-mode
   emulators, the new option is '-one-insn-per-tb',
   and for system mode emulators it is a TCG accel
   property '-accel tcg,one-insn-per-tb=on'
 * updates all the places which currently directly touch
   the 'singlestep' global variable to instead get the
   current accelerator and query/set the QOM property
 * documents that the old -singlestep option is deprecated
 * adds a new HMP command 'one-insn-per-tb', and deprecates
   the old 'singlestep' command. (Strictly we don't need to
   deprecate HMP commands, but I'd already written the code
   for v1 of this series and it's a minor user convenience.)
 * makes the HMP 'info status' output report "one insn per TB"
   instead of "single step mode"
 * adds a new 'one-insn-per-tb' member to the QMP StatusInfo
   type, and deprecates the old 'singlestep' field

Notes:
 * I hope I have got the QMP changes and deprecation right,
   but that's probably the bit in most need of review from
   an expert
 * There's an argument for just dropping the reporting of
   one-insn-per-tb in QMP StatusInfo at all, except that
   (a) it's hard to know if anybody's really using it
   (b) then the info isn't reported to HMP 'info status',
       which wouldn't line up with HMP having a mechanism
       to get/set the value
 * I have written patch 3 on the assumption that curr_cflags()
   is not such a hot codepath that we can't afford to have
   a QOM cast macro in it; the alternative would be to
   keep it using a global variable but make the global be
   restricted to accel/tcg/internals.h. RTH: opinions welcome...
 * Still haven't tested on bsd-user, but the patch is identical
   to the linux-user change

thanks
-- PMM

Peter Maydell (10):
  make one-insn-per-tb an accel option
  softmmu: Don't use 'singlestep' global in QMP and HMP commands
  tcg: Use one-insn-per-tb accelerator property in curr_cflags()
  linux-user: Add '-one-insn-per-tb' option equivalent to '-singlestep'
  bsd-user: Add '-one-insn-per-tb' option equivalent to '-singlestep'
  Document that -singlestep command line option is deprecated
  hmp: Add 'one-insn-per-tb' command equivalent to 'singlestep'
  hmp: Report 'one-insn-per-tb', not 'single step mode', in 'info
    status' output
  qapi/run-state.json: Fix missing newline at end of file
  hmp: Deprecate 'singlestep' member of StatusInfo

 docs/about/deprecated.rst   | 35 +++++++++++++++++++++++++++++++++++
 docs/interop/qmp-intro.txt  |  1 +
 docs/user/main.rst          | 14 ++++++++++++--
 qapi/run-state.json         | 19 +++++++++++++++----
 accel/tcg/internal.h        | 16 ++++++++++++++++
 include/exec/cpu-common.h   |  3 ---
 include/monitor/hmp.h       |  2 +-
 accel/tcg/cpu-exec.c        |  5 +++--
 accel/tcg/tcg-all.c         | 32 ++++++++++++++++++--------------
 bsd-user/main.c             | 14 +++++++++-----
 linux-user/main.c           | 18 ++++++++++++------
 softmmu/globals.c           |  1 -
 softmmu/runstate-hmp-cmds.c | 22 ++++++++++++++++++----
 softmmu/runstate.c          | 12 +++++++++++-
 softmmu/vl.c                | 17 +++++++++++++++--
 tests/qtest/test-hmp.c      |  1 +
 hmp-commands.hx             | 25 +++++++++++++++++++++----
 qemu-options.hx             | 12 ++++++++++--
 tcg/tci/README              |  2 +-
 19 files changed, 199 insertions(+), 52 deletions(-)

-- 
2.34.1



^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2023-04-14  6:18 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-03 14:46 [PATCH v2 00/10] Deprecate/rename singlestep command line option, monitor interfaces Peter Maydell
2023-04-03 14:46 ` [PATCH v2 01/10] make one-insn-per-tb an accel option Peter Maydell
2023-04-03 18:23   ` Richard Henderson
2023-04-03 14:46 ` [PATCH v2 02/10] softmmu: Don't use 'singlestep' global in QMP and HMP commands Peter Maydell
2023-04-03 18:25   ` Richard Henderson
2023-04-03 14:46 ` [PATCH v2 03/10] tcg: Use one-insn-per-tb accelerator property in curr_cflags() Peter Maydell
2023-04-03 18:33   ` Richard Henderson
2023-04-13 16:24     ` Peter Maydell
2023-04-14  6:17       ` Richard Henderson
2023-04-03 14:46 ` [PATCH v2 04/10] linux-user: Add '-one-insn-per-tb' option equivalent to '-singlestep' Peter Maydell
2023-04-03 18:35   ` Richard Henderson
2023-04-03 20:48     ` Warner Losh
2023-04-03 14:46 ` [PATCH v2 05/10] bsd-user: " Peter Maydell
2023-04-03 19:20   ` Richard Henderson
2023-04-03 20:46   ` Warner Losh
2023-04-03 14:46 ` [PATCH v2 06/10] Document that -singlestep command line option is deprecated Peter Maydell
2023-04-03 19:21   ` Richard Henderson
2023-04-03 14:46 ` [PATCH v2 07/10] hmp: Add 'one-insn-per-tb' command equivalent to 'singlestep' Peter Maydell
2023-04-03 17:52   ` Dr. David Alan Gilbert
2023-04-03 19:22   ` Richard Henderson
2023-04-03 14:46 ` [PATCH v2 08/10] hmp: Report 'one-insn-per-tb', not 'single step mode', in 'info status' output Peter Maydell
2023-04-03 19:22   ` Richard Henderson
2023-04-03 14:46 ` [PATCH v2 09/10] qapi/run-state.json: Fix missing newline at end of file Peter Maydell
2023-04-03 19:22   ` Richard Henderson
2023-04-03 14:46 ` [PATCH v2 10/10] hmp: Deprecate 'singlestep' member of StatusInfo Peter Maydell
2023-04-04  8:25   ` Markus Armbruster
2023-04-04  9:17     ` Peter Maydell
2023-04-04 13:25       ` Markus Armbruster
2023-04-04 14:24         ` Peter Maydell
2023-04-04 14:55           ` Paolo Bonzini
2023-04-05 14:56           ` Dr. David Alan Gilbert
2023-04-05 14:59             ` Peter Maydell
2023-04-05 15:01               ` Dr. David Alan Gilbert
2023-04-04 14:11       ` Paolo Bonzini
2023-04-03 16:42 ` [PATCH v2 00/10] Deprecate/rename singlestep command line option, monitor interfaces Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).