[PATCH v3 00/51] accel/tcg: Use IntervalTree for breakpoints and watchpoints

Richard Henderson posted 51 patches 1 day, 3 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260710205401.836304-1-richard.henderson@linaro.org
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, Pedro Barbuda <pbarbuda@microsoft.com>, Mohamed Mediouni <mohamed@unpredictable.fr>, "Philippe Mathieu-Daudé" <philmd@mailo.com>, "Alex Bennée" <alex.bennee@linaro.org>, Zhao Liu <zhao1.liu@intel.com>, Laurent Vivier <laurent@vivier.eu>, Helge Deller <deller@gmx.de>, Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>, Peter Maydell <peter.maydell@linaro.org>, Alexander Graf <agraf@csgraf.de>, Marcelo Tosatti <mtosatti@redhat.com>, Song Gao <17746591750@163.com>, Bibo Mao <maobibo@loongson.cn>, Xianglai Li <lixianglai@loongson.cn>, Nicholas Piggin <npiggin@gmail.com>, Chinmay Rath <rathc@linux.ibm.com>, Glenn Miles <milesg@linux.ibm.com>, Harsh Prateek Bora <harshpb@linux.ibm.com>, Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Weiwei Li <liwei1518@gmail.com>, Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>, Chao Liu <chao.liu@processmission.com>, Cornelia Huck <cohuck@redhat.com>, Eric Farman <farman@linux.ibm.com>, Matthew Rosato <mjrosato@linux.ibm.com>, Ilya Leoshkevich <iii@linux.ibm.com>, David Hildenbrand <david@kernel.org>, Halil Pasic <pasic@linux.ibm.com>, Christian Borntraeger <borntraeger@linux.ibm.com>, Max Filippov <jcmvbkbc@gmail.com>
include/accel/tcg/cpu-ops.h         |  17 +-
include/exec/breakpoint.h           |  36 ++--
include/exec/cputlb.h               |  12 +-
include/exec/watchpoint.h           |  18 --
include/hw/core/cpu.h               |  21 +--
include/qemu/typedefs.h             |   1 +
target/arm/cpu.h                    |   4 +-
target/arm/internals.h              |  18 +-
target/i386/cpu.h                   |   4 +-
target/i386/tcg/helper-tcg.h        |   4 +-
target/ppc/cpu.h                    |   4 +-
target/ppc/internal.h               |   6 +-
target/riscv/cpu.h                  |   4 +-
target/riscv/debug.h                |   5 +-
target/s390x/tcg/tcg_s390x.h        |   2 +-
target/xtensa/cpu.h                 |   8 +-
accel/tcg/cpu-exec.c                |  76 ++++----
accel/tcg/cputlb.c                  | 113 ++++++------
accel/tcg/tcg-accel-ops.c           |  37 ++--
accel/tcg/user-exec-stub.c          |  19 +-
accel/tcg/watchpoint.c              | 170 +++++++++---------
accel/whpx/whpx-common.c            |   9 +-
cpu-common.c                        |  68 +++----
gdbstub/system.c                    |  49 +++---
gdbstub/user.c                      |   9 +-
hw/core/cpu-common.c                |   2 -
linux-user/main.c                   |  14 +-
system/watchpoint.c                 |  80 ++++-----
target/arm/cpu.c                    |   1 -
target/arm/debug_helper.c           |  14 +-
target/arm/hvf/hvf.c                |   6 +-
target/arm/hyp_gdbstub.c            |   7 +-
target/arm/kvm.c                    |   5 +-
target/arm/tcg/cpu-v7m.c            |   1 -
target/arm/tcg/debug.c              | 263 +++++++++++++---------------
target/arm/tcg/mte_helper.c         |   3 +-
target/arm/tcg/tlb-insns.c          |  23 +--
target/hppa/mem_helper.c            |   3 +-
target/i386/cpu.c                   |   2 +-
target/i386/kvm/kvm.c               |  11 +-
target/i386/machine.c               |   2 +-
target/i386/tcg/bpt_helper.c        |   2 +-
target/i386/tcg/system/bpt_helper.c |  81 ++++-----
target/i386/tcg/tcg-cpu.c           |   2 +-
target/i386/whpx/whpx-all.c         |  15 +-
target/loongarch/tcg/tlb_helper.c   |   5 +-
target/ppc/cpu.c                    |   9 +-
target/ppc/cpu_init.c               |   2 +-
target/ppc/kvm.c                    |  14 +-
target/ppc/mmu_helper.c             |   4 +-
target/ppc/tcg-excp_helper.c        |  85 ++++-----
target/riscv/cpu_helper.c           |   6 +-
target/riscv/debug.c                | 159 +++--------------
target/riscv/tcg/tcg-cpu.c          |   4 +-
target/s390x/helper.c               |   1 -
target/s390x/kvm/kvm.c              |   7 +-
target/s390x/tcg/debug.c            |  28 +--
target/xtensa/cpu.c                 |   2 +-
target/xtensa/dbg_helper.c          |  31 ++--
target/xtensa/helper.c              |  46 ++---
60 files changed, 732 insertions(+), 922 deletions(-)
delete mode 100644 include/exec/watchpoint.h
[PATCH v3 00/51] accel/tcg: Use IntervalTree for breakpoints and watchpoints
Posted by Richard Henderson 1 day, 3 hours ago
Changes for v3:
  - Handle ARMv6 BE-32 within debug_check_watchpoint.
  - Drop adjust_watchpoint_address.
  - Change cpu_watchpoint_insert from addr+len to first+last.
    - Change tlb_flush_range_by_mmuidx to use first+last.
    - Use tlb_flush_range_by_mmuidx in cpu_watchpoint_insert.


r~


Philippe Mathieu-Daudé (1):
  cpu: Define BreakpointFlags type

Richard Henderson (50):
  exec/breakpoint: Move BP declarations from hw/core/cpu.h
  exec/breakpoint: Merge watchpoint.h
  qemu/typedefs: Declare CPUBreakpoint and CPUWatchpoint globally
  hw/core/cpu: Remove exec/breakpoint.h include
  exec/breakpoint: Add CPUBreakpoint.id
  exec/watchpoint: Add CPUWatchpoint.id
  accel/tcg: Pass CPUBreakpoint to debug_check_breakpoint
  target/arm: Split is_wp out of bp_wp_matches
  target/arm: Use bp argument in arm_debug_check_breakpoint
  target/arm: Use wp argument in arm_debug_check_watchpoint
  target/riscv: Use bp argument in riscv_cpu_debug_check_breakpoint
  target/riscv: Use bp argument in riscv_cpu_debug_check_watchpoint
  target/xtensa: Use bp argument in xtensa_debug_check_breakpoint
  cpu: Use interval-tree for CPUBreakpoint
  target/arm: Make check_watchpoint_in_range static
  gdbstub: Report actual watchpoint trigger address
  cpu: Use interval-tree for CPUWatchpoint
  exec/breakpoint: Return the new bp from cpu_breakpoint_insert
  system: Remove cpu_watchpoint_insert error return path
  exec/breakpoint: Return the new wp from cpu_watchpoint_insert
  system: Validate flags in cpu_watchpoint_insert
  cpu-common: Validate flags in cpu_breakpoint_insert
  exec/breakpoint: Add CPUWatchpoint.hitlast
  exec/breakpoint: Merge CPUBreakpoint and CPUWatchpoint
  accel/tcg: Pass watchpoint hit to debug_excp_handler
  accel/tcg: Pass breakpoint hit to debug_excp_handler
  target/arm: Use CPUBreakpoint arg in arm_debug_excp_handler
  target/i386: Pass wp_hit to check_hw_breakpoints
  target/i386: Use CPUBreakpoint arg in breakpoint_handler
  target/ppc: Use CPUBreakpoint arg in breakpoint_handler
  target/ppc: Simplify ppc_cpu_debug_check_breakpoint
  target/ppc: Simplify ppc_cpu_debug_check_watchpoint
  target/s390x: Use CPUBreakpoint arg in breakpoint_handler
  target/riscv: Simplify riscv_cpu_debug_excp_handler
  target/riscv: Set badaddr in riscv_cpu_debug_excp_handler
  target/riscv: Merge riscv_cpu_debug_check_{break,watch}point
  target/xtensa: Restrict xtensa_breakpoint_handler to system mode
  target/xtensa: Rename xtensa_breakpoint_handler
  target/xtensa: Simplify xtensa_cpu_debug_excp_handler
  accel/tcg: Clear BP_WATCHPOINT_HIT after use
  accel/tcg: Merge CPUState.{break,watch}point_hit
  target/arm: Simplify v6 watchpoints
  accel/tcg: Remove TCGCPUOps.adjust_watchpoint_address
  accel/tcg: Move ALL_MMUIDX_BITS to hw/core/cpu.h
  accel/tcg: Drop stale assert for vaddr
  accel/tcg: Use addr/last in tlb_flush_range_locked
  target/arm: Be more defensive for invalid tlbi_aa64_get_range
  accel/tcg: Change tlb_flush_range_* to use addr/last
  system: Use tlb_flush_range_by_mmuidx in cpu_watchpoint_insert
  accel/tcg: Change cpu_watchpoint_insert to use addr/last

 include/accel/tcg/cpu-ops.h         |  17 +-
 include/exec/breakpoint.h           |  36 ++--
 include/exec/cputlb.h               |  12 +-
 include/exec/watchpoint.h           |  18 --
 include/hw/core/cpu.h               |  21 +--
 include/qemu/typedefs.h             |   1 +
 target/arm/cpu.h                    |   4 +-
 target/arm/internals.h              |  18 +-
 target/i386/cpu.h                   |   4 +-
 target/i386/tcg/helper-tcg.h        |   4 +-
 target/ppc/cpu.h                    |   4 +-
 target/ppc/internal.h               |   6 +-
 target/riscv/cpu.h                  |   4 +-
 target/riscv/debug.h                |   5 +-
 target/s390x/tcg/tcg_s390x.h        |   2 +-
 target/xtensa/cpu.h                 |   8 +-
 accel/tcg/cpu-exec.c                |  76 ++++----
 accel/tcg/cputlb.c                  | 113 ++++++------
 accel/tcg/tcg-accel-ops.c           |  37 ++--
 accel/tcg/user-exec-stub.c          |  19 +-
 accel/tcg/watchpoint.c              | 170 +++++++++---------
 accel/whpx/whpx-common.c            |   9 +-
 cpu-common.c                        |  68 +++----
 gdbstub/system.c                    |  49 +++---
 gdbstub/user.c                      |   9 +-
 hw/core/cpu-common.c                |   2 -
 linux-user/main.c                   |  14 +-
 system/watchpoint.c                 |  80 ++++-----
 target/arm/cpu.c                    |   1 -
 target/arm/debug_helper.c           |  14 +-
 target/arm/hvf/hvf.c                |   6 +-
 target/arm/hyp_gdbstub.c            |   7 +-
 target/arm/kvm.c                    |   5 +-
 target/arm/tcg/cpu-v7m.c            |   1 -
 target/arm/tcg/debug.c              | 263 +++++++++++++---------------
 target/arm/tcg/mte_helper.c         |   3 +-
 target/arm/tcg/tlb-insns.c          |  23 +--
 target/hppa/mem_helper.c            |   3 +-
 target/i386/cpu.c                   |   2 +-
 target/i386/kvm/kvm.c               |  11 +-
 target/i386/machine.c               |   2 +-
 target/i386/tcg/bpt_helper.c        |   2 +-
 target/i386/tcg/system/bpt_helper.c |  81 ++++-----
 target/i386/tcg/tcg-cpu.c           |   2 +-
 target/i386/whpx/whpx-all.c         |  15 +-
 target/loongarch/tcg/tlb_helper.c   |   5 +-
 target/ppc/cpu.c                    |   9 +-
 target/ppc/cpu_init.c               |   2 +-
 target/ppc/kvm.c                    |  14 +-
 target/ppc/mmu_helper.c             |   4 +-
 target/ppc/tcg-excp_helper.c        |  85 ++++-----
 target/riscv/cpu_helper.c           |   6 +-
 target/riscv/debug.c                | 159 +++--------------
 target/riscv/tcg/tcg-cpu.c          |   4 +-
 target/s390x/helper.c               |   1 -
 target/s390x/kvm/kvm.c              |   7 +-
 target/s390x/tcg/debug.c            |  28 +--
 target/xtensa/cpu.c                 |   2 +-
 target/xtensa/dbg_helper.c          |  31 ++--
 target/xtensa/helper.c              |  46 ++---
 60 files changed, 732 insertions(+), 922 deletions(-)
 delete mode 100644 include/exec/watchpoint.h

-- 
2.43.0