@samitouri / QOSamiQemu / commits / 0c4f68b2e3

accel: Use GdbBreakpointType enum

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> Message-ID: <20260705215729.62196-26-philmd@oss.qualcomm.com>

Philippe Mathieu-Daudé committed Jun 26, 2026 at 17:30 UTC 0c4f68b2e340d52d2878fac1cd21c43e661f5c6b
19 files changed +118 -81
accel/hvf/hvf-accel-ops.c
+11 -9
@@ -233,7 +233,8 @@ int hvf_update_guest_debug(CPUState *cpu)
233 return 0;
234 }
235
236 -static int hvf_insert_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len)
236 +static int hvf_insert_gdbstub_breakpoint(CPUState *cpu, GdbBreakpointType type,
237 + vaddr addr, vaddr len)
238 {
239 struct hvf_sw_breakpoint *bp;
240 int err;
@@ -256,7 +257,7 @@ static int hvf_insert_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len)
257
258 QTAILQ_INSERT_HEAD(&hvf_state->hvf_sw_breakpoints, bp, entry);
259 } else {
259 - err = hvf_arch_insert_hw_breakpoint(addr, len, type);
260 + err = hvf_arch_insert_gdbstub_hw_breakpoint(addr, len, type);
261 if (err) {
262 return err;
263 }
@@ -271,7 +272,8 @@ static int hvf_insert_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len)
272 return 0;
273 }
274
274 -static int hvf_remove_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len)
275 +static int hvf_remove_gdbstub_breakpoint(CPUState *cpu, GdbBreakpointType type,
276 + vaddr addr, vaddr len)
277 {
278 struct hvf_sw_breakpoint *bp;
279 int err;
@@ -295,7 +297,7 @@ static int hvf_remove_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len)
297 QTAILQ_REMOVE(&hvf_state->hvf_sw_breakpoints, bp, entry);
298 g_free(bp);
299 } else {
298 - err = hvf_arch_remove_hw_breakpoint(addr, len, type);
300 + err = hvf_arch_remove_gdbstub_hw_breakpoint(addr, len, type);
301 if (err) {
302 return err;
303 }
@@ -310,7 +312,7 @@ static int hvf_remove_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len)
312 return 0;
313 }
314
313 -static void hvf_remove_all_breakpoints(CPUState *cpu)
315 +static void hvf_remove_all_gdbstub_breakpoints(CPUState *cpu)
316 {
317 struct hvf_sw_breakpoint *bp, *next;
318 CPUState *tmpcpu;
@@ -328,7 +330,7 @@ static void hvf_remove_all_breakpoints(CPUState *cpu)
330 QTAILQ_REMOVE(&hvf_state->hvf_sw_breakpoints, bp, entry);
331 g_free(bp);
332 }
331 - hvf_arch_remove_all_hw_breakpoints();
333 + hvf_arch_remove_all_gdbstub_hw_breakpoints();
334
335 CPU_FOREACH(cpu) {
336 hvf_update_guest_debug(cpu);
@@ -365,9 +367,9 @@ static void hvf_accel_ops_class_init(ObjectClass *oc, const void *data)
367 ops->synchronize_state = hvf_cpu_synchronize_state;
368 ops->synchronize_pre_loadvm = hvf_cpu_synchronize_pre_loadvm;
369
368 - ops->insert_breakpoint = hvf_insert_breakpoint;
369 - ops->remove_breakpoint = hvf_remove_breakpoint;
370 - ops->remove_all_breakpoints = hvf_remove_all_breakpoints;
370 + ops->insert_gdbstub_breakpoint = hvf_insert_gdbstub_breakpoint;
371 + ops->remove_gdbstub_breakpoint = hvf_remove_gdbstub_breakpoint;
372 + ops->remove_all_gdbstub_breakpoints = hvf_remove_all_gdbstub_breakpoints;
373 ops->update_guest_debug = hvf_update_guest_debug;
374
375 ops->get_vcpu_stats = hvf_get_vcpu_stats;
accel/kvm/kvm-accel-ops.c
+3 -3
@@ -107,9 +107,9 @@ static void kvm_accel_ops_class_init(ObjectClass *oc, const void *data)
107
108 #ifdef TARGET_KVM_HAVE_GUEST_DEBUG
109 ops->update_guest_debug = kvm_update_guest_debug_ops;
110 - ops->insert_breakpoint = kvm_insert_breakpoint;
111 - ops->remove_breakpoint = kvm_remove_breakpoint;
112 - ops->remove_all_breakpoints = kvm_remove_all_breakpoints;
110 + ops->insert_gdbstub_breakpoint = kvm_insert_gdbstub_breakpoint;
111 + ops->remove_gdbstub_breakpoint = kvm_remove_gdbstub_breakpoint;
112 + ops->remove_all_gdbstub_breakpoints = kvm_remove_all_gdbstub_breakpoints;
113 #endif
114 }
115
accel/kvm/kvm-all.c
+8 -6
@@ -3826,7 +3826,8 @@ int kvm_update_guest_debug(CPUState *cpu, unsigned long reinject_trap)
3826 return data.err;
3827 }
3828
3829 -int kvm_insert_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len)
3829 +int kvm_insert_gdbstub_breakpoint(CPUState *cpu, GdbBreakpointType type,
3830 + vaddr addr, vaddr len)
3831 {
3832 struct kvm_sw_breakpoint *bp;
3833 int err;
@@ -3849,7 +3850,7 @@ int kvm_insert_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len)
3850
3851 QTAILQ_INSERT_HEAD(&cpu->kvm_state->kvm_sw_breakpoints, bp, entry);
3852 } else {
3852 - err = kvm_arch_insert_hw_breakpoint(addr, len, type);
3853 + err = kvm_arch_insert_gdbstub_hw_breakpoint(addr, len, type);
3854 if (err) {
3855 return err;
3856 }
@@ -3864,7 +3865,8 @@ int kvm_insert_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len)
3865 return 0;
3866 }
3867
3867 -int kvm_remove_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len)
3868 +int kvm_remove_gdbstub_breakpoint(CPUState *cpu, GdbBreakpointType type,
3869 + vaddr addr, vaddr len)
3870 {
3871 struct kvm_sw_breakpoint *bp;
3872 int err;
@@ -3888,7 +3890,7 @@ int kvm_remove_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len)
3890 QTAILQ_REMOVE(&cpu->kvm_state->kvm_sw_breakpoints, bp, entry);
3891 g_free(bp);
3892 } else {
3891 - err = kvm_arch_remove_hw_breakpoint(addr, len, type);
3893 + err = kvm_arch_remove_gdbstub_hw_breakpoint(addr, len, type);
3894 if (err) {
3895 return err;
3896 }
@@ -3903,7 +3905,7 @@ int kvm_remove_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len)
3905 return 0;
3906 }
3907
3906 -void kvm_remove_all_breakpoints(CPUState *cpu)
3908 +void kvm_remove_all_gdbstub_breakpoints(CPUState *cpu)
3909 {
3910 struct kvm_sw_breakpoint *bp, *next;
3911 KVMState *s = cpu->kvm_state;
@@ -3921,7 +3923,7 @@ void kvm_remove_all_breakpoints(CPUState *cpu)
3923 QTAILQ_REMOVE(&s->kvm_sw_breakpoints, bp, entry);
3924 g_free(bp);
3925 }
3924 - kvm_arch_remove_all_hw_breakpoints();
3926 + kvm_arch_remove_all_gdbstub_hw_breakpoints();
3927
3928 CPU_FOREACH(cpu) {
3929 kvm_update_guest_debug(cpu, 0);
accel/kvm/kvm-cpus.h
+8 -3
@@ -10,13 +10,18 @@
10 #ifndef KVM_CPUS_H
11 #define KVM_CPUS_H
12
13 +#include "gdbstub/enums.h"
14 +
15 int kvm_init_vcpu(CPUState *cpu, Error **errp);
16 int kvm_cpu_exec(CPUState *cpu);
17 void kvm_destroy_vcpu(CPUState *cpu);
18 void kvm_cpu_synchronize_post_reset(CPUState *cpu);
19 void kvm_cpu_synchronize_post_init(CPUState *cpu);
20 void kvm_cpu_synchronize_pre_loadvm(CPUState *cpu);
19 -int kvm_insert_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len);
20 -int kvm_remove_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len);
21 -void kvm_remove_all_breakpoints(CPUState *cpu);
21 +int kvm_insert_gdbstub_breakpoint(CPUState *cpu, GdbBreakpointType type,
22 + vaddr addr, vaddr len);
23 +int kvm_remove_gdbstub_breakpoint(CPUState *cpu, GdbBreakpointType type,
24 + vaddr addr, vaddr len);
25 +void kvm_remove_all_gdbstub_breakpoints(CPUState *cpu);
26 +
27 #endif /* KVM_CPUS_H */
accel/tcg/tcg-accel-ops.c
+9 -7
@@ -110,7 +110,7 @@ void tcg_handle_interrupt(CPUState *cpu, int mask)
110 }
111
112 /* Translate GDB watchpoint type to a flags value for cpu_watchpoint_* */
113 -static inline int xlat_gdb_type(CPUState *cpu, int gdbtype)
113 +static inline int xlat_gdb_type(CPUState *cpu, GdbBreakpointType gdbtype)
114 {
115 static const int xlat[] = {
116 [GDB_WATCHPOINT_WRITE] = BP_GDB | BP_MEM_WRITE,
@@ -126,7 +126,8 @@ static inline int xlat_gdb_type(CPUState *cpu, int gdbtype)
126 return cputype;
127 }
128
129 -static int tcg_insert_breakpoint(CPUState *cs, int type, vaddr addr, vaddr len)
129 +static int tcg_insert_gdbstub_breakpoint(CPUState *cs, GdbBreakpointType type,
130 + vaddr addr, vaddr len)
131 {
132 CPUState *cpu;
133 int err = 0;
@@ -157,7 +158,8 @@ static int tcg_insert_breakpoint(CPUState *cs, int type, vaddr addr, vaddr len)
158 }
159 }
160
160 -static int tcg_remove_breakpoint(CPUState *cs, int type, vaddr addr, vaddr len)
161 +static int tcg_remove_gdbstub_breakpoint(CPUState *cs, GdbBreakpointType type,
162 + vaddr addr, vaddr len)
163 {
164 CPUState *cpu;
165 int err = 0;
@@ -188,7 +190,7 @@ static int tcg_remove_breakpoint(CPUState *cs, int type, vaddr addr, vaddr len)
190 }
191 }
192
191 -static void tcg_remove_all_breakpoints(CPUState *cpu)
193 +static void tcg_remove_all_gdbstub_breakpoints(CPUState *cpu)
194 {
195 cpu_breakpoint_remove_all(cpu, BP_GDB);
196 cpu_watchpoint_remove_all(cpu, BP_GDB);
@@ -216,9 +218,9 @@ static void tcg_accel_ops_init(AccelClass *ac)
218 }
219
220 ops->cpu_reset_hold = tcg_cpu_reset_hold;
219 - ops->insert_breakpoint = tcg_insert_breakpoint;
220 - ops->remove_breakpoint = tcg_remove_breakpoint;
221 - ops->remove_all_breakpoints = tcg_remove_all_breakpoints;
221 + ops->insert_gdbstub_breakpoint = tcg_insert_gdbstub_breakpoint;
222 + ops->remove_gdbstub_breakpoint = tcg_remove_gdbstub_breakpoint;
223 + ops->remove_all_gdbstub_breakpoints = tcg_remove_all_gdbstub_breakpoints;
224 }
225
226 static void tcg_accel_ops_class_init(ObjectClass *oc, const void *data)
gdbstub/system.c
+6 -6
@@ -627,8 +627,8 @@ int gdb_breakpoint_insert(CPUState *cs, GdbBreakpointType type,
627 vaddr addr, vaddr len)
628 {
629 const AccelOpsClass *ops = cpus_get_accel();
630 - if (ops->insert_breakpoint) {
631 - return ops->insert_breakpoint(cs, type, addr, len);
630 + if (ops->insert_gdbstub_breakpoint) {
631 + return ops->insert_gdbstub_breakpoint(cs, type, addr, len);
632 }
633 return -ENOSYS;
634 }
@@ -637,8 +637,8 @@ int gdb_breakpoint_remove(CPUState *cs, GdbBreakpointType type,
637 vaddr addr, vaddr len)
638 {
639 const AccelOpsClass *ops = cpus_get_accel();
640 - if (ops->remove_breakpoint) {
641 - return ops->remove_breakpoint(cs, type, addr, len);
640 + if (ops->remove_gdbstub_breakpoint) {
641 + return ops->remove_gdbstub_breakpoint(cs, type, addr, len);
642 }
643 return -ENOSYS;
644 }
@@ -646,8 +646,8 @@ int gdb_breakpoint_remove(CPUState *cs, GdbBreakpointType type,
646 void gdb_breakpoint_remove_all(CPUState *cs)
647 {
648 const AccelOpsClass *ops = cpus_get_accel();
649 - if (ops->remove_all_breakpoints) {
650 - ops->remove_all_breakpoints(cs);
649 + if (ops->remove_all_gdbstub_breakpoints) {
650 + ops->remove_all_gdbstub_breakpoints(cs);
651 }
652 }
653
include/accel/accel-cpu-ops.h
+6 -3
@@ -13,6 +13,7 @@
13 #include "qemu/accel.h"
14 #include "exec/vaddr.h"
15 #include "qom/object.h"
16 +#include "gdbstub/enums.h"
17
18 #define ACCEL_OPS_SUFFIX "-ops"
19 #define TYPE_ACCEL_OPS "accel" ACCEL_OPS_SUFFIX
@@ -85,9 +86,11 @@ struct AccelOpsClass {
86
87 /* gdbstub hooks */
88 int (*update_guest_debug)(CPUState *cpu);
88 - int (*insert_breakpoint)(CPUState *cpu, int type, vaddr addr, vaddr len);
89 - int (*remove_breakpoint)(CPUState *cpu, int type, vaddr addr, vaddr len);
90 - void (*remove_all_breakpoints)(CPUState *cpu);
89 + int (*insert_gdbstub_breakpoint)(CPUState *cpu, GdbBreakpointType type,
90 + vaddr addr, vaddr len);
91 + int (*remove_gdbstub_breakpoint)(CPUState *cpu, GdbBreakpointType type,
92 + vaddr addr, vaddr len);
93 + void (*remove_all_gdbstub_breakpoints)(CPUState *cpu);
94 };
95
96 void generic_handle_interrupt(CPUState *cpu, int mask);
include/system/hvf_int.h
+6 -3
@@ -13,6 +13,7 @@
13
14 #include "qemu/queue.h"
15 #include "exec/vaddr.h"
16 +#include "gdbstub/enums.h"
17 #include "qom/object.h"
18 #include "accel/accel-ops.h"
19
@@ -91,9 +92,11 @@ int hvf_sw_breakpoints_active(CPUState *cpu);
92
93 int hvf_arch_insert_sw_breakpoint(CPUState *cpu, struct hvf_sw_breakpoint *bp);
94 int hvf_arch_remove_sw_breakpoint(CPUState *cpu, struct hvf_sw_breakpoint *bp);
94 -int hvf_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type);
95 -int hvf_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type);
96 -void hvf_arch_remove_all_hw_breakpoints(void);
95 +int hvf_arch_insert_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
96 + GdbBreakpointType type);
97 +int hvf_arch_remove_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
98 + GdbBreakpointType type);
99 +void hvf_arch_remove_all_gdbstub_hw_breakpoints(void);
100
101 /*
102 * hvf_update_guest_debug:
include/system/kvm.h
+6 -3
@@ -17,6 +17,7 @@
17 #define QEMU_KVM_H
18
19 #include "exec/memattrs.h"
20 +#include "gdbstub/enums.h"
21 #include "qemu/accel.h"
22 #include "accel/accel-route.h"
23 #include "qom/object.h"
@@ -412,9 +413,11 @@ int kvm_arch_insert_sw_breakpoint(CPUState *cpu,
413 struct kvm_sw_breakpoint *bp);
414 int kvm_arch_remove_sw_breakpoint(CPUState *cpu,
415 struct kvm_sw_breakpoint *bp);
415 -int kvm_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type);
416 -int kvm_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type);
417 -void kvm_arch_remove_all_hw_breakpoints(void);
416 +int kvm_arch_insert_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
417 + GdbBreakpointType type);
418 +int kvm_arch_remove_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
419 + GdbBreakpointType type);
420 +void kvm_arch_remove_all_gdbstub_hw_breakpoints(void);
421
422 void kvm_arch_update_guest_debug(CPUState *cpu, struct kvm_guest_debug *dbg);
423
target/arm/hvf/hvf.c
+7 -5
@@ -2726,7 +2726,8 @@ int hvf_arch_remove_sw_breakpoint(CPUState *cpu, struct hvf_sw_breakpoint *bp)
2726 return 0;
2727 }
2728
2729 -int hvf_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type)
2729 +int hvf_arch_insert_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
2730 + GdbBreakpointType type)
2731 {
2732 switch (type) {
2733 case GDB_BREAKPOINT_HW:
@@ -2734,13 +2735,14 @@ int hvf_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type)
2735 case GDB_WATCHPOINT_READ:
2736 case GDB_WATCHPOINT_WRITE:
2737 case GDB_WATCHPOINT_ACCESS:
2737 - return insert_hw_watchpoint(addr, len, type);
2738 + return insert_gdbstub_hw_watchpoint(addr, len, type);
2739 default:
2740 return -ENOSYS;
2741 }
2742 }
2743
2743 -int hvf_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type)
2744 +int hvf_arch_remove_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
2745 + GdbBreakpointType type)
2746 {
2747 switch (type) {
2748 case GDB_BREAKPOINT_HW:
@@ -2748,13 +2750,13 @@ int hvf_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type)
2750 case GDB_WATCHPOINT_READ:
2751 case GDB_WATCHPOINT_WRITE:
2752 case GDB_WATCHPOINT_ACCESS:
2751 - return delete_hw_watchpoint(addr, len, type);
2753 + return delete_gdbstub_hw_watchpoint(addr, len, type);
2754 default:
2755 return -ENOSYS;
2756 }
2757 }
2758
2757 -void hvf_arch_remove_all_hw_breakpoints(void)
2759 +void hvf_arch_remove_all_gdbstub_hw_breakpoints(void)
2760 {
2761 if (cur_hw_wps > 0) {
2762 g_array_remove_range(hw_watchpoints, 0, cur_hw_wps);
target/arm/hyp_gdbstub.c
+4 -4
@@ -94,7 +94,7 @@ int delete_hw_breakpoint(vaddr pc)
94 }
95
96 /**
97 - * insert_hw_watchpoint()
97 + * insert_gdbstub_hw_watchpoint()
98 * @addr: address of watch point
99 * @len: size of area
100 * @type: type of watch point
@@ -125,7 +125,7 @@ int delete_hw_breakpoint(vaddr pc)
125 * need to ensure you mask the address as required and set BAS=0xff
126 */
127
128 -int insert_hw_watchpoint(vaddr addr, vaddr len, int type)
128 +int insert_gdbstub_hw_watchpoint(vaddr addr, vaddr len, GdbBreakpointType type)
129 {
130 HWWatchpoint wp = {
131 .wcr = R_DBGWCR_E_MASK, /* E=1, enable */
@@ -208,13 +208,13 @@ bool check_watchpoint_in_range(int i, vaddr addr)
208 }
209
210 /**
211 - * delete_hw_watchpoint()
211 + * delete_gdbstub_hw_watchpoint()
212 * @addr: address of breakpoint
213 *
214 * Delete a breakpoint and shuffle any above down
215 */
216
217 -int delete_hw_watchpoint(vaddr addr, vaddr len, int type)
217 +int delete_gdbstub_hw_watchpoint(vaddr addr, vaddr len, GdbBreakpointType type)
218 {
219 int i;
220 for (i = 0; i < cur_hw_wps; i++) {
target/arm/internals.h
+3 -2
@@ -29,6 +29,7 @@
29 #include "exec/vaddr.h"
30 #include "exec/breakpoint.h"
31 #include "exec/memop.h"
32 +#include "gdbstub/enums.h"
33 #ifdef CONFIG_TCG
34 #include "accel/tcg/tb-cpu-state.h"
35 #include "tcg/tcg-gvec-desc.h"
@@ -1968,8 +1969,8 @@ int delete_hw_breakpoint(vaddr pc);
1969
1970 bool check_watchpoint_in_range(int i, vaddr addr);
1971 CPUWatchpoint *find_hw_watchpoint(CPUState *cpu, vaddr addr);
1971 -int insert_hw_watchpoint(vaddr addr, vaddr len, int type);
1972 -int delete_hw_watchpoint(vaddr addr, vaddr len, int type);
1972 +int insert_gdbstub_hw_watchpoint(vaddr addr, vaddr len, GdbBreakpointType type);
1973 +int delete_gdbstub_hw_watchpoint(vaddr addr, vaddr len, GdbBreakpointType type);
1974
1975 /* Return the current value of the system counter in ticks */
1976 uint64_t gt_get_countervalue(CPUARMState *env);
target/arm/kvm.c
+7 -5
@@ -1784,7 +1784,8 @@ void kvm_arch_accel_class_init(ObjectClass *oc)
1784 "Eager Page Split chunk size for hugepages. (default: 0, disabled)");
1785 }
1786
1787 -int kvm_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type)
1787 +int kvm_arch_insert_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
1788 + GdbBreakpointType type)
1789 {
1790 switch (type) {
1791 case GDB_BREAKPOINT_HW:
@@ -1793,13 +1794,14 @@ int kvm_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type)
1794 case GDB_WATCHPOINT_READ:
1795 case GDB_WATCHPOINT_WRITE:
1796 case GDB_WATCHPOINT_ACCESS:
1796 - return insert_hw_watchpoint(addr, len, type);
1797 + return insert_gdbstub_hw_watchpoint(addr, len, type);
1798 default:
1799 return -ENOSYS;
1800 }
1801 }
1802
1802 -int kvm_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type)
1803 +int kvm_arch_remove_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
1804 + GdbBreakpointType type)
1805 {
1806 switch (type) {
1807 case GDB_BREAKPOINT_HW:
@@ -1807,13 +1809,13 @@ int kvm_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type)
1809 case GDB_WATCHPOINT_READ:
1810 case GDB_WATCHPOINT_WRITE:
1811 case GDB_WATCHPOINT_ACCESS:
1810 - return delete_hw_watchpoint(addr, len, type);
1812 + return delete_gdbstub_hw_watchpoint(addr, len, type);
1813 default:
1814 return -ENOSYS;
1815 }
1816 }
1817
1816 -void kvm_arch_remove_all_hw_breakpoints(void)
1818 +void kvm_arch_remove_all_gdbstub_hw_breakpoints(void)
1819 {
1820 if (cur_hw_wps > 0) {
1821 g_array_remove_range(hw_watchpoints, 0, cur_hw_wps);
target/i386/hvf/hvf.c
+5 -3
@@ -1049,17 +1049,19 @@ int hvf_arch_remove_sw_breakpoint(CPUState *cpu, struct hvf_sw_breakpoint *bp)
1049 return -ENOSYS;
1050 }
1051
1052 -int hvf_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type)
1052 +int hvf_arch_insert_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
1053 + GdbBreakpointType type)
1054 {
1055 return -ENOSYS;
1056 }
1057
1057 -int hvf_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type)
1058 +int hvf_arch_remove_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
1059 + GdbBreakpointType type)
1060 {
1061 return -ENOSYS;
1062 }
1063
1062 -void hvf_arch_remove_all_hw_breakpoints(void)
1064 +void hvf_arch_remove_all_gdbstub_hw_breakpoints(void)
1065 {
1066 }
1067
target/i386/kvm/kvm.c
+7 -5
@@ -6159,12 +6159,12 @@ int kvm_arch_remove_sw_breakpoint(CPUState *cs, struct kvm_sw_breakpoint *bp)
6159 static struct {
6160 target_ulong addr;
6161 int len;
6162 - int type;
6162 + GdbBreakpointType type;
6163 } hw_breakpoint[4];
6164
6165 static int nb_hw_breakpoint;
6166
6167 -static int find_hw_breakpoint(target_ulong addr, int len, int type)
6167 +static int find_hw_breakpoint(target_ulong addr, int len, GdbBreakpointType type)
6168 {
6169 int n;
6170
@@ -6177,7 +6177,8 @@ static int find_hw_breakpoint(target_ulong addr, int len, int type)
6177 return -1;
6178 }
6179
6180 -int kvm_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type)
6180 +int kvm_arch_insert_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
6181 + GdbBreakpointType type)
6182 {
6183 switch (type) {
6184 case GDB_BREAKPOINT_HW:
@@ -6217,7 +6218,8 @@ int kvm_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type)
6218 return 0;
6219 }
6220
6220 -int kvm_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type)
6221 +int kvm_arch_remove_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
6222 + GdbBreakpointType type)
6223 {
6224 int n;
6225
@@ -6231,7 +6233,7 @@ int kvm_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type)
6233 return 0;
6234 }
6235
6234 -void kvm_arch_remove_all_hw_breakpoints(void)
6236 +void kvm_arch_remove_all_gdbstub_hw_breakpoints(void)
6237 {
6238 nb_hw_breakpoint = 0;
6239 }
target/loongarch/kvm/kvm.c
+5 -3
@@ -1418,17 +1418,19 @@ int kvm_arch_remove_sw_breakpoint(CPUState *cs, struct kvm_sw_breakpoint *bp)
1418 return 0;
1419 }
1420
1421 -int kvm_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type)
1421 +int kvm_arch_insert_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
1422 + GdbBreakpointType type)
1423 {
1424 return -ENOSYS;
1425 }
1426
1426 -int kvm_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type)
1427 +int kvm_arch_remove_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
1428 + GdbBreakpointType type)
1429 {
1430 return -ENOSYS;
1431 }
1432
1431 -void kvm_arch_remove_all_hw_breakpoints(void)
1433 +void kvm_arch_remove_all_gdbstub_hw_breakpoints(void)
1434 {
1435 }
1436
target/ppc/kvm.c
+7 -5
@@ -455,7 +455,7 @@ unsigned long kvm_arch_vcpu_id(CPUState *cpu)
455
456 static struct HWBreakpoint {
457 target_ulong addr;
458 - int type;
458 + GdbBreakpointType type;
459 } hw_debug_points[MAX_HW_BKPTS];
460
461 static CPUWatchpoint hw_watchpoint;
@@ -1412,7 +1412,7 @@ int kvm_arch_remove_sw_breakpoint(CPUState *cs, struct kvm_sw_breakpoint *bp)
1412 return 0;
1413 }
1414
1415 -static int find_hw_breakpoint(target_ulong addr, int type)
1415 +static int find_hw_breakpoint(target_ulong addr, GdbBreakpointType type)
1416 {
1417 int n;
1418
@@ -1454,7 +1454,8 @@ static int find_hw_watchpoint(target_ulong addr, int *flag)
1454 return -1;
1455 }
1456
1457 -int kvm_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type)
1457 +int kvm_arch_insert_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
1458 + GdbBreakpointType type)
1459 {
1460 const unsigned breakpoint_index = nb_hw_breakpoint + nb_hw_watchpoint;
1461 if (breakpoint_index >= ARRAY_SIZE(hw_debug_points)) {
@@ -1498,7 +1499,8 @@ int kvm_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type)
1499 return 0;
1500 }
1501
1501 -int kvm_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type)
1502 +int kvm_arch_remove_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
1503 + GdbBreakpointType type)
1504 {
1505 int n;
1506
@@ -1526,7 +1528,7 @@ int kvm_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type)
1528 return 0;
1529 }
1530
1529 -void kvm_arch_remove_all_hw_breakpoints(void)
1531 +void kvm_arch_remove_all_gdbstub_hw_breakpoints(void)
1532 {
1533 nb_hw_breakpoint = nb_hw_watchpoint = 0;
1534 }
target/riscv/kvm/kvm-cpu.c
+5 -3
@@ -2215,19 +2215,21 @@ int kvm_arch_remove_sw_breakpoint(CPUState *cs, struct kvm_sw_breakpoint *bp)
2215 return 0;
2216 }
2217
2218 -int kvm_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type)
2218 +int kvm_arch_insert_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
2219 + GdbBreakpointType type)
2220 {
2221 /* TODO; To be implemented later. */
2222 return -EINVAL;
2223 }
2224
2224 -int kvm_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type)
2225 +int kvm_arch_remove_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
2226 + GdbBreakpointType type)
2227 {
2228 /* TODO; To be implemented later. */
2229 return -EINVAL;
2230 }
2231
2230 -void kvm_arch_remove_all_hw_breakpoints(void)
2232 +void kvm_arch_remove_all_gdbstub_hw_breakpoints(void)
2233 {
2234 /* TODO; To be implemented later. */
2235 }
target/s390x/kvm/kvm.c
+5 -3
@@ -907,7 +907,8 @@ static int insert_hw_breakpoint(vaddr addr, int len, int type)
907 return 0;
908 }
909
910 -int kvm_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type)
910 +int kvm_arch_insert_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
911 + GdbBreakpointType type)
912 {
913 switch (type) {
914 case GDB_BREAKPOINT_HW:
@@ -925,7 +926,8 @@ int kvm_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type)
926 return insert_hw_breakpoint(addr, len, type);
927 }
928
928 -int kvm_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type)
929 +int kvm_arch_remove_gdbstub_hw_breakpoint(vaddr addr, vaddr len,
930 + GdbBreakpointType type)
931 {
932 int size;
933 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)
956 return 0;
957 }
958
957 -void kvm_arch_remove_all_hw_breakpoints(void)
959 +void kvm_arch_remove_all_gdbstub_hw_breakpoints(void)
960 {
961 nb_hw_breakpoints = 0;
962 g_free(hw_breakpoints);