diff --git a/gdbstub.c b/gdbstub.c index 9ae657620e5e9e8b850cf2db65aa7bf62c949180..f7d9f136195398f33be18dfc4418e75811c14d40 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -2019,7 +2019,7 @@ static void gdb_breakpoint_remove_all(void) CPUArchState *env; if (kvm_enabled()) { - kvm_remove_all_breakpoints(gdbserver_state->c_cpu); + kvm_remove_all_breakpoints(ENV_GET_CPU(gdbserver_state->c_cpu)); return; } diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index 7596acad7e710b669fb3bc5582e48b152edc5cc0..1e08a85116be80031acb708c5b5e29d72e2db1cf 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -173,7 +173,7 @@ int kvm_insert_breakpoint(CPUArchState *env, target_ulong addr, target_ulong len, int type); int kvm_remove_breakpoint(CPUArchState *env, target_ulong addr, target_ulong len, int type); -void kvm_remove_all_breakpoints(CPUArchState *env); +void kvm_remove_all_breakpoints(CPUState *cpu); int kvm_update_guest_debug(CPUArchState *env, unsigned long reinject_trap); #ifndef _WIN32 int kvm_set_signal_mask(CPUState *cpu, const sigset_t *sigset); diff --git a/kvm-all.c b/kvm-all.c index ed13d57104e0be27207c7fdce92fee3841f316aa..2c14ef3ef4821b49f0fd04bf743374b6c03a3233 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -1988,11 +1988,11 @@ int kvm_remove_breakpoint(CPUArchState *env, target_ulong addr, return 0; } -void kvm_remove_all_breakpoints(CPUArchState *env) +void kvm_remove_all_breakpoints(CPUState *cpu) { - CPUState *cpu = ENV_GET_CPU(env); struct kvm_sw_breakpoint *bp, *next; KVMState *s = cpu->kvm_state; + CPUArchState *env; QTAILQ_FOREACH_SAFE(bp, &s->kvm_sw_breakpoints, entry, next) { if (kvm_arch_remove_sw_breakpoint(cpu, bp) != 0) { @@ -2033,7 +2033,7 @@ int kvm_remove_breakpoint(CPUArchState *env, target_ulong addr, return -EINVAL; } -void kvm_remove_all_breakpoints(CPUArchState *env) +void kvm_remove_all_breakpoints(CPUState *cpu) { } #endif /* !KVM_CAP_SET_GUEST_DEBUG */ diff --git a/kvm-stub.c b/kvm-stub.c index 583c636d68b1f45b86d9e88bf5422266f42f973b..370c8371d5fe2b73f687be66ad3fd2c2078ceb9a 100644 --- a/kvm-stub.c +++ b/kvm-stub.c @@ -95,7 +95,7 @@ int kvm_remove_breakpoint(CPUArchState *env, target_ulong addr, return -EINVAL; } -void kvm_remove_all_breakpoints(CPUArchState *env) +void kvm_remove_all_breakpoints(CPUState *cpu) { }