summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'kvm-all.c')
-rw-r--r--kvm-all.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/kvm-all.c b/kvm-all.c
index d45bd46ac..b2651df8d 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -916,11 +916,15 @@ void kvm_setup_guest_memory(void *start, size_t size)
#ifdef KVM_UPSTREAM
static void on_vcpu(CPUState *env, void (*func)(void *data), void *data)
{
+#ifdef CONFIG_IOTHREAD
if (env == cpu_single_env) {
func(data);
return;
}
abort();
+#else
+ func(data);
+#endif
}
#endif /* KVM_UPSTREAM */
@@ -952,7 +956,13 @@ struct kvm_set_guest_debug_data {
static void kvm_invoke_set_guest_debug(void *data)
{
struct kvm_set_guest_debug_data *dbg_data = data;
- dbg_data->err = kvm_vcpu_ioctl(dbg_data->env, KVM_SET_GUEST_DEBUG, &dbg_data->dbg);
+ CPUState *env = dbg_data->env;
+
+ if (env->kvm_state->regs_modified) {
+ kvm_arch_put_registers(env);
+ env->kvm_state->regs_modified = 0;
+ }
+ dbg_data->err = kvm_vcpu_ioctl(env, KVM_SET_GUEST_DEBUG, &dbg_data->dbg);
}
int kvm_update_guest_debug(CPUState *env, unsigned long reinject_trap)