From: "Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
To: qemu-devel@nongnu.org
Cc: Chao Liu <chao.liu.zevorn@gmail.com>,
alex.bennee@linaro.org, qemu-s390x@nongnu.org,
Magnus Kulke <magnuskulke@linux.microsoft.com>,
Zhao Liu <zhao1.liu@intel.com>,
qemu-ppc@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
Xiaoyao Li <xiaoyao.li@intel.com>,
Richard Henderson <richard.henderson@linaro.org>,
Mohamed Mediouni <mohamed@unpredictable.fr>,
Peter Maydell <peter.maydell@linaro.org>
Subject: [PATCH v3 25/32] accel: Use GdbBreakpointType enum
Date: Sun, 5 Jul 2026 23:57:21 +0200 [thread overview]
Message-ID: <20260705215729.62196-26-philmd@oss.qualcomm.com> (raw)
In-Reply-To: <20260705215729.62196-1-philmd@oss.qualcomm.com>
Include '_gdbstub_' in the AccelOpsClass handlers to emphasize
we are handling gdbstub-related requests.
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
accel/kvm/kvm-cpus.h | 11 ++++++++---
include/accel/accel-cpu-ops.h | 9 ++++++---
include/system/hvf_int.h | 9 ++++++---
include/system/kvm.h | 9 ++++++---
target/arm/internals.h | 5 +++--
accel/hvf/hvf-accel-ops.c | 20 +++++++++++---------
accel/kvm/kvm-accel-ops.c | 6 +++---
accel/kvm/kvm-all.c | 14 ++++++++------
accel/tcg/tcg-accel-ops.c | 17 ++++++++++-------
gdbstub/system.c | 12 ++++++------
target/arm/hvf/hvf.c | 12 +++++++-----
target/arm/hyp_gdbstub.c | 8 ++++----
target/arm/kvm.c | 12 +++++++-----
target/i386/hvf/hvf.c | 8 +++++---
target/i386/kvm/kvm.c | 12 +++++++-----
target/loongarch/kvm/kvm.c | 8 +++++---
target/ppc/kvm.c | 12 +++++++-----
target/riscv/kvm/kvm-cpu.c | 8 +++++---
target/s390x/kvm/kvm.c | 8 +++++---
19 files changed, 119 insertions(+), 81 deletions(-)
diff --git a/accel/kvm/kvm-cpus.h b/accel/kvm/kvm-cpus.h
index 3185659562d..bc2dd82e68e 100644
--- a/accel/kvm/kvm-cpus.h
+++ b/accel/kvm/kvm-cpus.h
@@ -10,13 +10,18 @@
#ifndef KVM_CPUS_H
#define KVM_CPUS_H
+#include "gdbstub/enums.h"
+
int kvm_init_vcpu(CPUState *cpu, Error **errp);
int kvm_cpu_exec(CPUState *cpu);
void kvm_destroy_vcpu(CPUState *cpu);
void kvm_cpu_synchronize_post_reset(CPUState *cpu);
void kvm_cpu_synchronize_post_init(CPUState *cpu);
void kvm_cpu_synchronize_pre_loadvm(CPUState *cpu);
-int kvm_insert_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len);
-int kvm_remove_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len);
-void kvm_remove_all_breakpoints(CPUState *cpu);
+int kvm_insert_gdbstub_breakpoint(CPUState *cpu, GdbBreakpointType type,
+ vaddr addr, vaddr len);
+int kvm_remove_gdbstub_breakpoint(CPUState *cpu, GdbBreakpointType type,
+ vaddr addr, vaddr len);
+void kvm_remove_all_gdbstub_breakpoints(CPUState *cpu);
+
#endif /* KVM_CPUS_H */
diff --git a/include/accel/accel-cpu-ops.h b/include/accel/accel-cpu-ops.h
index b23a0606c7e..f0c7ee7542c 100644
--- a/include/accel/accel-cpu-ops.h
+++ b/include/accel/accel-cpu-ops.h
@@ -13,6 +13,7 @@
#include "qemu/accel.h"
#include "exec/vaddr.h"
#include "qom/object.h"
+#include "gdbstub/enums.h"
#define ACCEL_OPS_SUFFIX "-ops"
#define TYPE_ACCEL_OPS "accel" ACCEL_OPS_SUFFIX
@@ -85,9 +86,11 @@ struct AccelOpsClass {
/* gdbstub hooks */
int (*update_guest_debug)(CPUState *cpu);
- int (*insert_breakpoint)(CPUState *cpu, int type, vaddr addr, vaddr len);
- int (*remove_breakpoint)(CPUState *cpu, int type, vaddr addr, vaddr len);
- void (*remove_all_breakpoints)(CPUState *cpu);
+ int (*insert_gdbstub_breakpoint)(CPUState *cpu, GdbBreakpointType type,
+ vaddr addr, vaddr len);
+ int (*remove_gdbstub_breakpoint)(CPUState *cpu, GdbBreakpointType type,
+ vaddr addr, vaddr len);
+ void (*remove_all_gdbstub_breakpoints)(CPUState *cpu);
};
void generic_handle_interrupt(CPUState *cpu, int mask);
diff --git a/include/system/hvf_int.h b/include/system/hvf_int.h
index d64f4942556..a01691ce172 100644
--- a/include/system/hvf_int.h
+++ b/include/system/hvf_int.h
@@ -13,6 +13,7 @@
#include "qemu/queue.h"
#include "exec/vaddr.h"
+#include "gdbstub/enums.h"
#include "qom/object.h"
#include "accel/accel-ops.h"
@@ -91,9 +92,11 @@ int hvf_sw_breakpoints_active(CPUState *cpu);
int hvf_arch_insert_sw_breakpoint(CPUState *cpu, struct hvf_sw_breakpoint *bp);
int hvf_arch_remove_sw_breakpoint(CPUState *cpu, struct hvf_sw_breakpoint *bp);
-int hvf_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type);
-int hvf_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type);
-void hvf_arch_remove_all_hw_breakpoints(void);
+int hvf_arch_insert_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
+ GdbBreakpointType type);
+int hvf_arch_remove_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
+ GdbBreakpointType type);
+void hvf_arch_remove_all_gdbstub_hw_breakpoints(void);
/*
* hvf_update_guest_debug:
diff --git a/include/system/kvm.h b/include/system/kvm.h
index cdd1856ac5f..714b8c7b011 100644
--- a/include/system/kvm.h
+++ b/include/system/kvm.h
@@ -17,6 +17,7 @@
#define QEMU_KVM_H
#include "exec/memattrs.h"
+#include "gdbstub/enums.h"
#include "qemu/accel.h"
#include "accel/accel-route.h"
#include "qom/object.h"
@@ -412,9 +413,11 @@ int kvm_arch_insert_sw_breakpoint(CPUState *cpu,
struct kvm_sw_breakpoint *bp);
int kvm_arch_remove_sw_breakpoint(CPUState *cpu,
struct kvm_sw_breakpoint *bp);
-int kvm_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type);
-int kvm_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type);
-void kvm_arch_remove_all_hw_breakpoints(void);
+int kvm_arch_insert_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
+ GdbBreakpointType type);
+int kvm_arch_remove_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
+ GdbBreakpointType type);
+void kvm_arch_remove_all_gdbstub_hw_breakpoints(void);
void kvm_arch_update_guest_debug(CPUState *cpu, struct kvm_guest_debug *dbg);
diff --git a/target/arm/internals.h b/target/arm/internals.h
index fcce3804f34..067c3f2b8bb 100644
--- a/target/arm/internals.h
+++ b/target/arm/internals.h
@@ -29,6 +29,7 @@
#include "exec/vaddr.h"
#include "exec/breakpoint.h"
#include "exec/memop.h"
+#include "gdbstub/enums.h"
#ifdef CONFIG_TCG
#include "accel/tcg/tb-cpu-state.h"
#include "tcg/tcg-gvec-desc.h"
@@ -1968,8 +1969,8 @@ int delete_hw_breakpoint(vaddr pc);
bool check_watchpoint_in_range(int i, vaddr addr);
CPUWatchpoint *find_hw_watchpoint(CPUState *cpu, vaddr addr);
-int insert_hw_watchpoint(vaddr addr, vaddr len, int type);
-int delete_hw_watchpoint(vaddr addr, vaddr len, int type);
+int insert_gdbstub_hw_watchpoint(vaddr addr, vaddr len, GdbBreakpointType type);
+int delete_gdbstub_hw_watchpoint(vaddr addr, vaddr len, GdbBreakpointType type);
/* Return the current value of the system counter in ticks */
uint64_t gt_get_countervalue(CPUARMState *env);
diff --git a/accel/hvf/hvf-accel-ops.c b/accel/hvf/hvf-accel-ops.c
index ecc0cd1b558..d2276d8513e 100644
--- a/accel/hvf/hvf-accel-ops.c
+++ b/accel/hvf/hvf-accel-ops.c
@@ -233,7 +233,8 @@ int hvf_update_guest_debug(CPUState *cpu)
return 0;
}
-static int hvf_insert_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len)
+static int hvf_insert_gdbstub_breakpoint(CPUState *cpu, GdbBreakpointType type,
+ vaddr addr, vaddr len)
{
struct hvf_sw_breakpoint *bp;
int err;
@@ -256,7 +257,7 @@ static int hvf_insert_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len)
QTAILQ_INSERT_HEAD(&hvf_state->hvf_sw_breakpoints, bp, entry);
} else {
- err = hvf_arch_insert_hw_breakpoint(addr, len, type);
+ err = hvf_arch_insert_gdbstub_hw_breakpoint(addr, len, type);
if (err) {
return err;
}
@@ -271,7 +272,8 @@ static int hvf_insert_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len)
return 0;
}
-static int hvf_remove_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len)
+static int hvf_remove_gdbstub_breakpoint(CPUState *cpu, GdbBreakpointType type,
+ vaddr addr, vaddr len)
{
struct hvf_sw_breakpoint *bp;
int err;
@@ -295,7 +297,7 @@ static int hvf_remove_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len)
QTAILQ_REMOVE(&hvf_state->hvf_sw_breakpoints, bp, entry);
g_free(bp);
} else {
- err = hvf_arch_remove_hw_breakpoint(addr, len, type);
+ err = hvf_arch_remove_gdbstub_hw_breakpoint(addr, len, type);
if (err) {
return err;
}
@@ -310,7 +312,7 @@ static int hvf_remove_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len)
return 0;
}
-static void hvf_remove_all_breakpoints(CPUState *cpu)
+static void hvf_remove_all_gdbstub_breakpoints(CPUState *cpu)
{
struct hvf_sw_breakpoint *bp, *next;
CPUState *tmpcpu;
@@ -328,7 +330,7 @@ static void hvf_remove_all_breakpoints(CPUState *cpu)
QTAILQ_REMOVE(&hvf_state->hvf_sw_breakpoints, bp, entry);
g_free(bp);
}
- hvf_arch_remove_all_hw_breakpoints();
+ hvf_arch_remove_all_gdbstub_hw_breakpoints();
CPU_FOREACH(cpu) {
hvf_update_guest_debug(cpu);
@@ -365,9 +367,9 @@ static void hvf_accel_ops_class_init(ObjectClass *oc, const void *data)
ops->synchronize_state = hvf_cpu_synchronize_state;
ops->synchronize_pre_loadvm = hvf_cpu_synchronize_pre_loadvm;
- ops->insert_breakpoint = hvf_insert_breakpoint;
- ops->remove_breakpoint = hvf_remove_breakpoint;
- ops->remove_all_breakpoints = hvf_remove_all_breakpoints;
+ ops->insert_gdbstub_breakpoint = hvf_insert_gdbstub_breakpoint;
+ ops->remove_gdbstub_breakpoint = hvf_remove_gdbstub_breakpoint;
+ ops->remove_all_gdbstub_breakpoints = hvf_remove_all_gdbstub_breakpoints;
ops->update_guest_debug = hvf_update_guest_debug;
ops->get_vcpu_stats = hvf_get_vcpu_stats;
diff --git a/accel/kvm/kvm-accel-ops.c b/accel/kvm/kvm-accel-ops.c
index 45330327909..c8e7aa38709 100644
--- a/accel/kvm/kvm-accel-ops.c
+++ b/accel/kvm/kvm-accel-ops.c
@@ -107,9 +107,9 @@ static void kvm_accel_ops_class_init(ObjectClass *oc, const void *data)
#ifdef TARGET_KVM_HAVE_GUEST_DEBUG
ops->update_guest_debug = kvm_update_guest_debug_ops;
- ops->insert_breakpoint = kvm_insert_breakpoint;
- ops->remove_breakpoint = kvm_remove_breakpoint;
- ops->remove_all_breakpoints = kvm_remove_all_breakpoints;
+ ops->insert_gdbstub_breakpoint = kvm_insert_gdbstub_breakpoint;
+ ops->remove_gdbstub_breakpoint = kvm_remove_gdbstub_breakpoint;
+ ops->remove_all_gdbstub_breakpoints = kvm_remove_all_gdbstub_breakpoints;
#endif
}
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index b03488ebac3..feffca0d82d 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -3826,7 +3826,8 @@ int kvm_update_guest_debug(CPUState *cpu, unsigned long reinject_trap)
return data.err;
}
-int kvm_insert_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len)
+int kvm_insert_gdbstub_breakpoint(CPUState *cpu, GdbBreakpointType type,
+ vaddr addr, vaddr len)
{
struct kvm_sw_breakpoint *bp;
int err;
@@ -3849,7 +3850,7 @@ int kvm_insert_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len)
QTAILQ_INSERT_HEAD(&cpu->kvm_state->kvm_sw_breakpoints, bp, entry);
} else {
- err = kvm_arch_insert_hw_breakpoint(addr, len, type);
+ err = kvm_arch_insert_gdbstub_hw_breakpoint(addr, len, type);
if (err) {
return err;
}
@@ -3864,7 +3865,8 @@ int kvm_insert_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len)
return 0;
}
-int kvm_remove_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len)
+int kvm_remove_gdbstub_breakpoint(CPUState *cpu, GdbBreakpointType type,
+ vaddr addr, vaddr len)
{
struct kvm_sw_breakpoint *bp;
int err;
@@ -3888,7 +3890,7 @@ int kvm_remove_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len)
QTAILQ_REMOVE(&cpu->kvm_state->kvm_sw_breakpoints, bp, entry);
g_free(bp);
} else {
- err = kvm_arch_remove_hw_breakpoint(addr, len, type);
+ err = kvm_arch_remove_gdbstub_hw_breakpoint(addr, len, type);
if (err) {
return err;
}
@@ -3903,7 +3905,7 @@ int kvm_remove_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len)
return 0;
}
-void kvm_remove_all_breakpoints(CPUState *cpu)
+void kvm_remove_all_gdbstub_breakpoints(CPUState *cpu)
{
struct kvm_sw_breakpoint *bp, *next;
KVMState *s = cpu->kvm_state;
@@ -3921,7 +3923,7 @@ void kvm_remove_all_breakpoints(CPUState *cpu)
QTAILQ_REMOVE(&s->kvm_sw_breakpoints, bp, entry);
g_free(bp);
}
- kvm_arch_remove_all_hw_breakpoints();
+ kvm_arch_remove_all_gdbstub_hw_breakpoints();
CPU_FOREACH(cpu) {
kvm_update_guest_debug(cpu, 0);
diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c
index c54acc770e3..028265c2efd 100644
--- a/accel/tcg/tcg-accel-ops.c
+++ b/accel/tcg/tcg-accel-ops.c
@@ -110,7 +110,8 @@ void tcg_handle_interrupt(CPUState *cpu, int mask)
}
/* Translate GDB watchpoint type to a flags value for cpu_watchpoint_* */
-static inline BreakpointFlags xlat_gdb_type(CPUState *cpu, int gdbtype)
+static inline BreakpointFlags xlat_gdb_type(CPUState *cpu,
+ GdbBreakpointType gdbtype)
{
static const BreakpointFlags xlat[] = {
[GDB_WATCHPOINT_WRITE] = BP_GDB | BP_MEM_WRITE,
@@ -126,7 +127,8 @@ static inline BreakpointFlags xlat_gdb_type(CPUState *cpu, int gdbtype)
return cpuflags;
}
-static int tcg_insert_breakpoint(CPUState *cs, int type, vaddr addr, vaddr len)
+static int tcg_insert_gdbstub_breakpoint(CPUState *cs, GdbBreakpointType type,
+ vaddr addr, vaddr len)
{
CPUState *cpu;
int err = 0;
@@ -157,7 +159,8 @@ static int tcg_insert_breakpoint(CPUState *cs, int type, vaddr addr, vaddr len)
}
}
-static int tcg_remove_breakpoint(CPUState *cs, int type, vaddr addr, vaddr len)
+static int tcg_remove_gdbstub_breakpoint(CPUState *cs, GdbBreakpointType type,
+ vaddr addr, vaddr len)
{
CPUState *cpu;
int err = 0;
@@ -188,7 +191,7 @@ static int tcg_remove_breakpoint(CPUState *cs, int type, vaddr addr, vaddr len)
}
}
-static void tcg_remove_all_breakpoints(CPUState *cpu)
+static void tcg_remove_all_gdbstub_breakpoints(CPUState *cpu)
{
cpu_breakpoint_remove_all(cpu, BP_GDB);
cpu_watchpoint_remove_all(cpu, BP_GDB);
@@ -216,9 +219,9 @@ static void tcg_accel_ops_init(AccelClass *ac)
}
ops->cpu_reset_hold = tcg_cpu_reset_hold;
- ops->insert_breakpoint = tcg_insert_breakpoint;
- ops->remove_breakpoint = tcg_remove_breakpoint;
- ops->remove_all_breakpoints = tcg_remove_all_breakpoints;
+ ops->insert_gdbstub_breakpoint = tcg_insert_gdbstub_breakpoint;
+ ops->remove_gdbstub_breakpoint = tcg_remove_gdbstub_breakpoint;
+ ops->remove_all_gdbstub_breakpoints = tcg_remove_all_gdbstub_breakpoints;
}
static void tcg_accel_ops_class_init(ObjectClass *oc, const void *data)
diff --git a/gdbstub/system.c b/gdbstub/system.c
index 6e2dbc823e3..3098fd55740 100644
--- a/gdbstub/system.c
+++ b/gdbstub/system.c
@@ -627,8 +627,8 @@ int gdb_breakpoint_insert(CPUState *cs, GdbBreakpointType type,
vaddr addr, vaddr len)
{
const AccelOpsClass *ops = cpus_get_accel();
- if (ops->insert_breakpoint) {
- return ops->insert_breakpoint(cs, type, addr, len);
+ if (ops->insert_gdbstub_breakpoint) {
+ return ops->insert_gdbstub_breakpoint(cs, type, addr, len);
}
return -ENOSYS;
}
@@ -637,8 +637,8 @@ int gdb_breakpoint_remove(CPUState *cs, GdbBreakpointType type,
vaddr addr, vaddr len)
{
const AccelOpsClass *ops = cpus_get_accel();
- if (ops->remove_breakpoint) {
- return ops->remove_breakpoint(cs, type, addr, len);
+ if (ops->remove_gdbstub_breakpoint) {
+ return ops->remove_gdbstub_breakpoint(cs, type, addr, len);
}
return -ENOSYS;
}
@@ -646,8 +646,8 @@ int gdb_breakpoint_remove(CPUState *cs, GdbBreakpointType type,
void gdb_breakpoint_remove_all(CPUState *cs)
{
const AccelOpsClass *ops = cpus_get_accel();
- if (ops->remove_all_breakpoints) {
- ops->remove_all_breakpoints(cs);
+ if (ops->remove_all_gdbstub_breakpoints) {
+ ops->remove_all_gdbstub_breakpoints(cs);
}
}
diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c
index e16457c3cfb..d5b1966a867 100644
--- a/target/arm/hvf/hvf.c
+++ b/target/arm/hvf/hvf.c
@@ -2726,7 +2726,8 @@ int hvf_arch_remove_sw_breakpoint(CPUState *cpu, struct hvf_sw_breakpoint *bp)
return 0;
}
-int hvf_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type)
+int hvf_arch_insert_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
+ GdbBreakpointType type)
{
switch (type) {
case GDB_BREAKPOINT_HW:
@@ -2734,13 +2735,14 @@ int hvf_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type)
case GDB_WATCHPOINT_READ:
case GDB_WATCHPOINT_WRITE:
case GDB_WATCHPOINT_ACCESS:
- return insert_hw_watchpoint(addr, len, type);
+ return insert_gdbstub_hw_watchpoint(addr, len, type);
default:
return -ENOSYS;
}
}
-int hvf_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type)
+int hvf_arch_remove_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
+ GdbBreakpointType type)
{
switch (type) {
case GDB_BREAKPOINT_HW:
@@ -2748,13 +2750,13 @@ int hvf_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type)
case GDB_WATCHPOINT_READ:
case GDB_WATCHPOINT_WRITE:
case GDB_WATCHPOINT_ACCESS:
- return delete_hw_watchpoint(addr, len, type);
+ return delete_gdbstub_hw_watchpoint(addr, len, type);
default:
return -ENOSYS;
}
}
-void hvf_arch_remove_all_hw_breakpoints(void)
+void hvf_arch_remove_all_gdbstub_hw_breakpoints(void)
{
if (cur_hw_wps > 0) {
g_array_remove_range(hw_watchpoints, 0, cur_hw_wps);
diff --git a/target/arm/hyp_gdbstub.c b/target/arm/hyp_gdbstub.c
index bb5969720ce..dda6946ddaa 100644
--- a/target/arm/hyp_gdbstub.c
+++ b/target/arm/hyp_gdbstub.c
@@ -94,7 +94,7 @@ int delete_hw_breakpoint(vaddr pc)
}
/**
- * insert_hw_watchpoint()
+ * insert_gdbstub_hw_watchpoint()
* @addr: address of watch point
* @len: size of area
* @type: type of watch point
@@ -125,7 +125,7 @@ int delete_hw_breakpoint(vaddr pc)
* need to ensure you mask the address as required and set BAS=0xff
*/
-int insert_hw_watchpoint(vaddr addr, vaddr len, int type)
+int insert_gdbstub_hw_watchpoint(vaddr addr, vaddr len, GdbBreakpointType type)
{
HWWatchpoint wp = {
.wcr = R_DBGWCR_E_MASK, /* E=1, enable */
@@ -208,13 +208,13 @@ bool check_watchpoint_in_range(int i, vaddr addr)
}
/**
- * delete_hw_watchpoint()
+ * delete_gdbstub_hw_watchpoint()
* @addr: address of breakpoint
*
* Delete a breakpoint and shuffle any above down
*/
-int delete_hw_watchpoint(vaddr addr, vaddr len, int type)
+int delete_gdbstub_hw_watchpoint(vaddr addr, vaddr len, GdbBreakpointType type)
{
int i;
for (i = 0; i < cur_hw_wps; i++) {
diff --git a/target/arm/kvm.c b/target/arm/kvm.c
index a54ef51ec2a..01f42f42538 100644
--- a/target/arm/kvm.c
+++ b/target/arm/kvm.c
@@ -1784,7 +1784,8 @@ void kvm_arch_accel_class_init(ObjectClass *oc)
"Eager Page Split chunk size for hugepages. (default: 0, disabled)");
}
-int kvm_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type)
+int kvm_arch_insert_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
+ GdbBreakpointType type)
{
switch (type) {
case GDB_BREAKPOINT_HW:
@@ -1793,13 +1794,14 @@ int kvm_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type)
case GDB_WATCHPOINT_READ:
case GDB_WATCHPOINT_WRITE:
case GDB_WATCHPOINT_ACCESS:
- return insert_hw_watchpoint(addr, len, type);
+ return insert_gdbstub_hw_watchpoint(addr, len, type);
default:
return -ENOSYS;
}
}
-int kvm_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type)
+int kvm_arch_remove_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
+ GdbBreakpointType type)
{
switch (type) {
case GDB_BREAKPOINT_HW:
@@ -1807,13 +1809,13 @@ int kvm_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type)
case GDB_WATCHPOINT_READ:
case GDB_WATCHPOINT_WRITE:
case GDB_WATCHPOINT_ACCESS:
- return delete_hw_watchpoint(addr, len, type);
+ return delete_gdbstub_hw_watchpoint(addr, len, type);
default:
return -ENOSYS;
}
}
-void kvm_arch_remove_all_hw_breakpoints(void)
+void kvm_arch_remove_all_gdbstub_hw_breakpoints(void)
{
if (cur_hw_wps > 0) {
g_array_remove_range(hw_watchpoints, 0, cur_hw_wps);
diff --git a/target/i386/hvf/hvf.c b/target/i386/hvf/hvf.c
index 19ad64a1d93..150598418e2 100644
--- a/target/i386/hvf/hvf.c
+++ b/target/i386/hvf/hvf.c
@@ -1049,17 +1049,19 @@ int hvf_arch_remove_sw_breakpoint(CPUState *cpu, struct hvf_sw_breakpoint *bp)
return -ENOSYS;
}
-int hvf_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type)
+int hvf_arch_insert_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
+ GdbBreakpointType type)
{
return -ENOSYS;
}
-int hvf_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type)
+int hvf_arch_remove_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
+ GdbBreakpointType type)
{
return -ENOSYS;
}
-void hvf_arch_remove_all_hw_breakpoints(void)
+void hvf_arch_remove_all_gdbstub_hw_breakpoints(void)
{
}
diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
index 64cc421abe6..1e09155e92c 100644
--- a/target/i386/kvm/kvm.c
+++ b/target/i386/kvm/kvm.c
@@ -6159,12 +6159,12 @@ int kvm_arch_remove_sw_breakpoint(CPUState *cs, struct kvm_sw_breakpoint *bp)
static struct {
target_ulong addr;
int len;
- int type;
+ GdbBreakpointType type;
} hw_breakpoint[4];
static int nb_hw_breakpoint;
-static int find_hw_breakpoint(target_ulong addr, int len, int type)
+static int find_hw_breakpoint(target_ulong addr, int len, GdbBreakpointType type)
{
int n;
@@ -6177,7 +6177,8 @@ static int find_hw_breakpoint(target_ulong addr, int len, int type)
return -1;
}
-int kvm_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type)
+int kvm_arch_insert_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
+ GdbBreakpointType type)
{
switch (type) {
case GDB_BREAKPOINT_HW:
@@ -6217,7 +6218,8 @@ int kvm_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type)
return 0;
}
-int kvm_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type)
+int kvm_arch_remove_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
+ GdbBreakpointType type)
{
int n;
@@ -6231,7 +6233,7 @@ int kvm_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type)
return 0;
}
-void kvm_arch_remove_all_hw_breakpoints(void)
+void kvm_arch_remove_all_gdbstub_hw_breakpoints(void)
{
nb_hw_breakpoint = 0;
}
diff --git a/target/loongarch/kvm/kvm.c b/target/loongarch/kvm/kvm.c
index d6539c12acd..beda6965f8c 100644
--- a/target/loongarch/kvm/kvm.c
+++ b/target/loongarch/kvm/kvm.c
@@ -1418,17 +1418,19 @@ int kvm_arch_remove_sw_breakpoint(CPUState *cs, struct kvm_sw_breakpoint *bp)
return 0;
}
-int kvm_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type)
+int kvm_arch_insert_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
+ GdbBreakpointType type)
{
return -ENOSYS;
}
-int kvm_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type)
+int kvm_arch_remove_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
+ GdbBreakpointType type)
{
return -ENOSYS;
}
-void kvm_arch_remove_all_hw_breakpoints(void)
+void kvm_arch_remove_all_gdbstub_hw_breakpoints(void)
{
}
diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c
index 2a3711fb1df..6bdfbbd68d6 100644
--- a/target/ppc/kvm.c
+++ b/target/ppc/kvm.c
@@ -455,7 +455,7 @@ unsigned long kvm_arch_vcpu_id(CPUState *cpu)
static struct HWBreakpoint {
target_ulong addr;
- int type;
+ GdbBreakpointType type;
} hw_debug_points[MAX_HW_BKPTS];
static CPUWatchpoint hw_watchpoint;
@@ -1412,7 +1412,7 @@ int kvm_arch_remove_sw_breakpoint(CPUState *cs, struct kvm_sw_breakpoint *bp)
return 0;
}
-static int find_hw_breakpoint(target_ulong addr, int type)
+static int find_hw_breakpoint(target_ulong addr, GdbBreakpointType type)
{
int n;
@@ -1454,7 +1454,8 @@ static int find_hw_watchpoint(target_ulong addr, BreakpointFlags *flag)
return -1;
}
-int kvm_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type)
+int kvm_arch_insert_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
+ GdbBreakpointType type)
{
const unsigned breakpoint_index = nb_hw_breakpoint + nb_hw_watchpoint;
if (breakpoint_index >= ARRAY_SIZE(hw_debug_points)) {
@@ -1498,7 +1499,8 @@ int kvm_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type)
return 0;
}
-int kvm_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type)
+int kvm_arch_remove_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
+ GdbBreakpointType type)
{
int n;
@@ -1526,7 +1528,7 @@ int kvm_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type)
return 0;
}
-void kvm_arch_remove_all_hw_breakpoints(void)
+void kvm_arch_remove_all_gdbstub_hw_breakpoints(void)
{
nb_hw_breakpoint = nb_hw_watchpoint = 0;
}
diff --git a/target/riscv/kvm/kvm-cpu.c b/target/riscv/kvm/kvm-cpu.c
index 39d48a9db4d..2a5440d5846 100644
--- a/target/riscv/kvm/kvm-cpu.c
+++ b/target/riscv/kvm/kvm-cpu.c
@@ -2215,19 +2215,21 @@ int kvm_arch_remove_sw_breakpoint(CPUState *cs, struct kvm_sw_breakpoint *bp)
return 0;
}
-int kvm_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type)
+int kvm_arch_insert_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
+ GdbBreakpointType type)
{
/* TODO; To be implemented later. */
return -EINVAL;
}
-int kvm_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type)
+int kvm_arch_remove_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
+ GdbBreakpointType type)
{
/* TODO; To be implemented later. */
return -EINVAL;
}
-void kvm_arch_remove_all_hw_breakpoints(void)
+void kvm_arch_remove_all_gdbstub_hw_breakpoints(void)
{
/* TODO; To be implemented later. */
}
diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c
index fdef8f9e8ac..195e39df032 100644
--- a/target/s390x/kvm/kvm.c
+++ b/target/s390x/kvm/kvm.c
@@ -907,7 +907,8 @@ static int insert_hw_breakpoint(vaddr addr, int len, int type)
return 0;
}
-int kvm_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type)
+int kvm_arch_insert_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
+ GdbBreakpointType type)
{
switch (type) {
case GDB_BREAKPOINT_HW:
@@ -925,7 +926,8 @@ int kvm_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type)
return insert_hw_breakpoint(addr, len, type);
}
-int kvm_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type)
+int kvm_arch_remove_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
+ GdbBreakpointType type)
{
int size;
struct kvm_hw_breakpoint *bp = find_hw_breakpoint(addr, len, type);
@@ -954,7 +956,7 @@ int kvm_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type)
return 0;
}
-void kvm_arch_remove_all_hw_breakpoints(void)
+void kvm_arch_remove_all_gdbstub_hw_breakpoints(void)
{
nb_hw_breakpoints = 0;
g_free(hw_breakpoints);
--
2.53.0
next prev parent reply other threads:[~2026-07-05 22:02 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-05 21:56 [PATCH v3 00/32] accel: Unassorted cleanups around debugging Philippe Mathieu-Daudé
2026-07-05 21:56 ` [PATCH v3 01/32] cpu: Constify CPUState::cc (cached CPUClass pointer) Philippe Mathieu-Daudé
2026-07-05 21:56 ` [PATCH v3 02/32] target/i386: Remove duplicate tlb_flush() call in cpu_post_load() Philippe Mathieu-Daudé
2026-07-05 21:56 ` [PATCH v3 03/32] accel/tcg: Restrict tlb_protect/unprotect_code() to TCG Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 04/32] accel/hvf: Remove left-over comment Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 05/32] accel/mshv: Replace @dirty field by generic CPUState::vcpu_dirty field Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 06/32] gdbstub: Add trace event for STEP packet handler Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 07/32] gdbstub: Only return E22 when reverse GDB is not supported Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 08/32] accel/whpx: Implement missing AccelClass::gdbstub_supported_sstep_flags Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 09/32] accel/kvm: Always define AccelOpsClass::supports_guest_debug Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 10/32] accel/kvm: Simplify kvm_init() w.r.t. TARGET_KVM_HAVE_GUEST_DEBUG Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 11/32] accel/kvm: Hold have_guest_debug in KVMState Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 12/32] gdbstub: Reduce gdb_supports_guest_debug() scope Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 13/32] gdbstub: Move supported_sstep_flags in AccelGdbConfig structure Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 14/32] accel: Have each implementation return their AccelGdbConfig Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 15/32] gdbstub: Make default replay_mode value explicit in stubs Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 16/32] accel: Hold @can_reverse information in AccelGdbConfig Philippe Mathieu-Daudé
2026-07-06 8:59 ` Manos Pitsidianakis
2026-07-05 21:57 ` [PATCH v3 17/32] accel: Remove AccelOpsClass::supports_guest_debug Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 18/32] cpu: Move cpu_breakpoint_test out of line Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 19/32] cpu: Move BREAKPOINT definitions to 'exec/breakpoint.h' Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 20/32] cpu: Define BreakpointFlags type Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 21/32] accel: Remove unnecessary 'inline' qualifier in remove_all_breakpoints Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 22/32] gdbstub/user: Directly call gdb_breakpoint_remove_all() in user mode Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 23/32] gdbstub: Reduce @type variable scope Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 24/32] gdbstub: Introduce GdbBreakpointType enumerator Philippe Mathieu-Daudé
2026-07-05 21:57 ` Philippe Mathieu-Daudé [this message]
2026-07-05 21:57 ` [PATCH v3 26/32] target/arm: Inline check_watchpoints() in arm_debug_check_watchpoint() Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 27/32] target/ppc: Ensure TCG is used in ppc_update_daw() Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 28/32] accel/tcg: Improve docstrings around TCGCPUOps::*watchpoint* handlers Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 29/32] cpu: Better name cpu_single_step() trace event Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 30/32] cpu: Introduce cpu_single_stepping() helper Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 31/32] cpu: Rename CPUState @singlestep_enabled -> @singlestep_flags Philippe Mathieu-Daudé
2026-07-05 21:57 ` [PATCH v3 32/32] cpu: Only check SSTEP_ENABLE flag in cpu_single_stepping() Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260705215729.62196-26-philmd@oss.qualcomm.com \
--to=philmd@oss.qualcomm.com \
--cc=alex.bennee@linaro.org \
--cc=chao.liu.zevorn@gmail.com \
--cc=magnuskulke@linux.microsoft.com \
--cc=mohamed@unpredictable.fr \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=xiaoyao.li@intel.com \
--cc=zhao1.liu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.