Skip to content

accel: Unassorted cleanups around debugging

Philippe Mathieu-Daudé qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest32 patches 1 replyIn review
  2. v233 patches 9 repliesSuperseded
  3. v133 patches 59 repliesSuperseded

Changes in v3 from the cover letter

- Fixed gdb_can_reverse (patch #16)
- & -> mask, == -> flags (patch #20)
- Dropped patch #29 (Move CPUWatchpoint def)

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/32cpu: Constify CPUState::cc (cached CPUClass pointer)accel/tcg/cpu-exec.c accel/tcg/translate-all.c gdbstub/gdbstub.c +1 more+4 -50 replies
2/32target/i386: Remove duplicate tlb_flush() call in cpu_post_load()target/i386/machine.c+0 -10 replies
3/32accel/tcg: Restrict tlb_protect/unprotect_code() to TCGaccel/tcg/cputlb.c accel/tcg/system-page-protection.h accel/tcg/tb-maint.c +1 more+22 -70 replies
4/32accel/hvf: Remove left-over commentaccel/hvf/hvf-accel-ops.c+0 -20 replies
5/32accel/mshv: Replace @dirty field by generic CPUState::vcpu_dirty fieldaccel/mshv/mshv-all.c include/system/mshv_int.h target/i386/mshv/mshv-cpu.c+12 -130 replies
6/32gdbstub: Add trace event for STEP packet handlergdbstub/gdbstub.c+1 -00 replies
7/32gdbstub: Only return E22 when reverse GDB is not supportedgdbstub/gdbstub.c+1 -00 replies
8/32accel/whpx: Implement missing AccelClass::gdbstub_supported_sstep_flagsaccel/whpx/whpx-common.c include/system/whpx-all.h target/arm/whpx/whpx-all.c +1 more+12 -00 replies
9/32accel/kvm: Always define AccelOpsClass::supports_guest_debugaccel/kvm/kvm-accel-ops.c+1 -10 replies
10/32accel/kvm: Simplify kvm_init() w.r.t. TARGET_KVM_HAVE_GUEST_DEBUGaccel/kvm/kvm-all.c+1 -40 replies
11/32accel/kvm: Hold have_guest_debug in KVMStateaccel/kvm/kvm-all.c include/system/kvm_int.h+6 -40 replies
12/32gdbstub: Reduce gdb_supports_guest_debug() scopegdbstub/internals.h gdbstub/system.c gdbstub/user.c+3 -80 replies
13/32gdbstub: Move supported_sstep_flags in AccelGdbConfig structuregdbstub/gdbstub.c gdbstub/internals.h include/qemu/accel.h+16 -60 replies
14/32accel: Have each implementation return their AccelGdbConfigaccel/accel-common.c accel/hvf/hvf-all.c accel/kvm/kvm-all.c +8 more+20 -710 replies
15/32gdbstub: Make default replay_mode value explicit in stubsstubs/replay-mode.c+1 -10 replies
16/32accel: Hold @can_reverse information in AccelGdbConfigaccel/tcg/tcg-all.c gdbstub/gdbstub.c gdbstub/internals.h +3 more+7 -141 reply
17/32accel: Remove AccelOpsClass::supports_guest_debugaccel/accel-common.c accel/hvf/hvf-accel-ops.c accel/kvm/kvm-accel-ops.c +15 more+10 -700 replies
18/32cpu: Move cpu_breakpoint_test out of linecpu-common.c include/hw/core/cpu.h+16 -150 replies
19/32cpu: Move BREAKPOINT definitions to 'exec/breakpoint.h'include/exec/breakpoint.h include/hw/core/cpu.h+14 -140 replies
20/32cpu: Define BreakpointFlags typeaccel/tcg/cputlb.c accel/tcg/tcg-accel-ops.c accel/tcg/user-exec-stub.c +15 more+56 -460 replies
21/32accel: Remove unnecessary 'inline' qualifier in remove_all_breakpointsaccel/tcg/tcg-accel-ops.c+1 -10 replies
22/32gdbstub/user: Directly call gdb_breakpoint_remove_all() in user modegdbstub/user.c+1 -10 replies
23/32gdbstub: Reduce @type variable scopegdbstub/system.c+2 -10 replies
24/32gdbstub: Introduce GdbBreakpointType enumeratorgdbstub/internals.h gdbstub/system.c gdbstub/user.c +1 more+20 -110 replies
25/32accel: Use GdbBreakpointType enumaccel/hvf/hvf-accel-ops.c accel/kvm/kvm-accel-ops.c accel/kvm/kvm-all.c +16 more+119 -810 replies
26/32target/arm: Inline check_watchpoints() in arm_debug_check_watchpoint()target/arm/tcg/debug.c+17 -230 replies
27/32target/ppc: Ensure TCG is used in ppc_update_daw()target/ppc/cpu.c+2 -00 replies
28/32accel/tcg: Improve docstrings around TCGCPUOps::*watchpoint* handlersinclude/accel/tcg/cpu-ops.h+2 -30 replies
29/32cpu: Better name cpu_single_step() trace eventcpu-target.c trace-events+3 -30 replies
30/32cpu: Introduce cpu_single_stepping() helperaccel/kvm/kvm-all.c accel/tcg/cpu-exec-common.c accel/tcg/cpu-exec.c +12 more+33 -220 replies
31/32cpu: Rename CPUState @singlestep_enabled -> @singlestep_flagsaccel/kvm/kvm-all.c accel/tcg/cpu-exec.c accel/tcg/tcg-accel-ops-rr.c +4 more+21 -210 replies
32/32cpu: Only check SSTEP_ENABLE flag in cpu_single_stepping()include/hw/core/cpu.h+1 -10 replies

Reviews trailers per patch

All 32 patches have a Reviewed-by or Acked-by.

PatchDaniel Henrique BarbozaRichard HendersonChao LiuMagnus KulkeAlex BennéePhilippe Mathieu-DaudéManos Pitsidianakis
1/32R-b R-b R-b
2/32R-b R-b
3/32R-b R-b R-b
4/32R-b R-b
5/32R-b T-b
6/32R-b A-b
7/32R-b R-b
8/32R-b R-b
9/32R-b R-b
10/32R-b
11/32R-b R-b
12/32R-b
13/32R-b
14/32R-b
15/32R-b
16/32R-b
17/32R-b
18/32R-b
19/32R-b R-b
20/32R-b R-b
21/32R-b R-b
22/32R-b R-b
23/32R-b R-b
24/32R-b R-b
25/32R-b R-b
26/32R-b
27/32R-b
28/32R-b R-b
29/32R-b
30/32R-b
31/32R-b
32/32R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 7 reviewers.

Read the v3 thread

Cover letter [PATCH v3 00/32] accel: Unassorted cleanups around debugging

Missing review: 16

Since v2:
- Fixed gdb_can_reverse (patch #16)
- & -> mask, == -> flags (patch #20)
- Dropped patch #29 (Move CPUWatchpoint def)

Since v1:
- Introduce AccelGdbConfig structure (Alex)
- Dropped target-specific Breakpoint/Watchpoint changes (Richard working on it)

Refreshing the `split-accel' preparatory work; this series follows "accel: Preparatory cleanups for split-accel" from last year:
https://lore.kernel.org/qemu-devel/[email protected]/

Nothing really noteworthy here, generic code refactoring with the objective to strengthen the various APIs, introducing few enums or headers.

I'm quite pleased with the total diff-stat.

Philippe Mathieu-Daudé (31):
cpu: Constify CPUState::cc (cached CPUClass pointer) target/i386: Remove duplicate tlb_flush() call in cpu_post_load() accel/tcg: Restrict tlb_protect/unprotect_code() to TCG accel/hvf: Remove left-over comment
accel/mshv: Replace @dirty field by generic CPUState::vcpu_dirty field
gdbstub: Add trace event for STEP packet handler
gdbstub: Only return E22 when reverse GDB is not supported accel/whpx: Implement missing
AccelClass::gdbstub_supported_sstep_flags
accel/kvm: Always define AccelOpsClass::supports_guest_debug accel/kvm: Simplify kvm_init() w.r.t. TARGET_KVM_HAVE_GUEST_DEBUG accel/kvm: Hold have_guest_debug in KVMState
gdbstub: Reduce gdb_supports_guest_debug() scope
gdbstub: Move supported_sstep_flags in AccelGdbConfig structure
accel: Have each implementation return their AccelGdbConfig
gdbstub: Make default replay_mode value explicit in stubs
accel: Hold @can_reverse information in AccelGdbConfig
accel: Remove AccelOpsClass::supports_guest_debug
cpu: Move BREAKPOINT definitions to 'exec/breakpoint.h'
cpu: Define BreakpointFlags type
accel: Remove unnecessary 'inline' qualifier in remove_all_breakpoints gdbstub/user: Directly call gdb_breakpoint_remove_all() in user mode
gdbstub: Reduce @type variable scope
gdbstub: Introduce GdbBreakpointType enumerator
accel: Use GdbBreakpointType enum
target/arm: Inline check_watchpoints() in arm_debug_check_watchpoint() target/ppc: Ensure TCG is used in ppc_update_daw() accel/tcg: Improve docstrings around TCGCPUOps::*watchpoint* handlers
cpu: Better name cpu_single_step() trace event
cpu: Introduce cpu_single_stepping() helper
cpu: Rename CPUState @singlestep_enabled -> @singlestep_flags
cpu: Only check SSTEP_ENABLE flag in cpu_single_stepping()

Richard Henderson (1):
cpu: Move cpu_breakpoint_test out of line

 docs/system/gdb.rst                |  2 +-
 accel/kvm/kvm-cpus.h               | 12 ++++---
 accel/tcg/system-page-protection.h | 17 ++++++++++
 gdbstub/internals.h                | 12 ++++---
 include/accel/accel-cpu-ops.h      | 10 +++---
 include/accel/accel-ops.h          |  5 ++-
 include/accel/tcg/cpu-ops.h        | 11 ++++---
 include/exec/breakpoint.h          | 19 +++++++++--
 include/exec/cputlb.h              |  8 ++---
 include/exec/watchpoint.h          |  6 ++--
 include/gdbstub/enums.h            | 12 ++++---
 include/hw/core/cpu.h              | 53 ++++++++++--------------------
 include/qemu/accel.h               | 13 +++++---
 include/system/hvf_int.h           | 14 ++++----
 include/system/kvm.h               |  9 +++--
 include/system/mshv_int.h          |  1 -
 include/system/whpx-all.h          |  3 --
 target/arm/internals.h             |  5 +--
 accel/accel-common.c               | 15 +++------
 accel/hvf/hvf-accel-ops.c          | 23 +++++++------
 accel/hvf/hvf-all.c                |  8 ++---
 accel/kvm/kvm-accel-ops.c          |  7 ++--
 accel/kvm/kvm-all.c                | 52 ++++++++---------------------
 accel/mshv/mshv-all.c              | 18 +++++-----
 accel/tcg/cpu-exec-common.c        |  2 +-
 accel/tcg/cpu-exec.c               | 12 +++----
 accel/tcg/cputlb.c                 | 15 +++++----
 accel/tcg/tb-maint.c               |  1 +
 accel/tcg/tcg-accel-ops-rr.c       |  2 +-
 accel/tcg/tcg-accel-ops.c          | 31 ++++++++---------
 accel/tcg/tcg-all.c                | 30 ++++++++---------
 accel/tcg/translate-all.c          |  3 +-
 accel/tcg/user-exec-stub.c         |  9 ++---
 accel/tcg/watchpoint.c             |  9 ++---
 accel/whpx/whpx-accel-ops.c        |  6 ----
 cpu-common.c                       | 19 +++++++++--
 cpu-target.c                       | 10 +++---
 gdbstub/gdbstub.c                  | 18 +++++-----
 gdbstub/system.c                   | 37 ++++++++-------------
 gdbstub/user.c                     | 20 +++--------
 linux-user/riscv/cpu_loop.c        |  2 +-
 linux-user/s390x/cpu_loop.c        |  2 +-
 stubs/replay-mode.c                |  2 +-
 system/cpus.c                      |  2 +-
 system/watchpoint.c                |  4 +--
 target/arm/hvf/hvf.c               | 27 +++++++--------
 target/arm/hyp_gdbstub.c           |  8 ++---
 target/arm/kvm.c                   | 14 ++++----
 target/arm/tcg/debug.c             | 44 +++++++++++--------------
 target/arm/tcg/mte_helper.c        |  3 +-
 target/arm/whpx/whpx-all.c         |  5 ---
 target/i386/hvf/hvf.c              | 13 +++-----
 target/i386/kvm/kvm.c              | 14 ++++----
 target/i386/machine.c              |  1 -
 target/i386/mshv/mshv-cpu.c        |  6 ++--
 target/i386/whpx/whpx-all.c        | 13 +++-----
 target/loongarch/kvm/kvm.c         | 10 +++---
 target/microblaze/translate.c      |  2 +-
 target/ppc/cpu.c                   |  4 ++-
 target/ppc/kvm.c                   | 19 ++++++-----
 target/ppc/translate.c             | 16 ++++-----
 target/riscv/cpu_helper.c          |  2 +-
 target/riscv/debug.c               | 12 +++----
 target/riscv/kvm/kvm-cpu.c         |  8 +++--
 target/s390x/kvm/kvm.c             | 10 +++---
 target/s390x/tcg/debug.c           |  3 +-
 target/xtensa/dbg_helper.c         |  2 +-
 trace-events                       |  2 +-
 68 files changed, 392 insertions(+), 417 deletions(-)
 create mode 100644 accel/tcg/system-page-protection.h
Signature · 1 line
2.53.0