Skip to content

Commit

Permalink
accel/kvm: move kvm_update_guest_debug to inline stub
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Bennée <[email protected]>
Message-Id: <[email protected]>
  • Loading branch information
stsquad committed Oct 6, 2022
1 parent a48e7d9 commit c7f1c53
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
6 changes: 0 additions & 6 deletions accel/kvm/kvm-all.c
Original file line number Diff line number Diff line change
Expand Up @@ -3395,12 +3395,6 @@ void kvm_remove_all_breakpoints(CPUState *cpu)
}
}

#else /* !KVM_CAP_SET_GUEST_DEBUG */

static int kvm_update_guest_debug(CPUState *cpu, unsigned long reinject_trap)
{
return -EINVAL;
}
#endif /* !KVM_CAP_SET_GUEST_DEBUG */

static int kvm_set_signal_mask(CPUState *cpu, const sigset_t *sigset)
Expand Down
5 changes: 0 additions & 5 deletions accel/stubs/kvm-stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ int kvm_has_many_ioeventfds(void)
return 0;
}

int kvm_update_guest_debug(CPUState *cpu, unsigned long reinject_trap)
{
return -ENOSYS;
}

int kvm_on_sigbus_vcpu(CPUState *cpu, int code, void *addr)
{
return 1;
Expand Down
16 changes: 16 additions & 0 deletions include/sysemu/kvm.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,23 @@ int kvm_on_sigbus(int code, void *addr);

void kvm_flush_coalesced_mmio_buffer(void);

/**
* kvm_update_guest_debug(): ensure KVM debug structures updated
* @cs: the CPUState for this cpu
* @reinject_trap: KVM trap injection control
*
* There are usually per-arch specifics which will be handled by
* calling down to kvm_arch_update_guest_debug after the generic
* fields have been set.
*/
#ifdef KVM_CAP_SET_GUEST_DEBUG
int kvm_update_guest_debug(CPUState *cpu, unsigned long reinject_trap);
#else
static inline int kvm_update_guest_debug(CPUState *cpu, unsigned long reinject_trap)
{
return -EINVAL;
}
#endif

/* internal API */

Expand Down

0 comments on commit c7f1c53

Please sign in to comment.