Without this, kvm will hold the mutex while it issues its run ioctl,
and never be able to step out of it, causing a deadlock.
Patchworks-ID: 35359
Signed-off-by: Glauber Costa <glommer@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
}
kvm_arch_pre_run(env, run);
+ qemu_mutex_unlock_iothread();
ret = kvm_vcpu_ioctl(env, KVM_RUN, 0);
+ qemu_mutex_lock_iothread();
kvm_arch_post_run(env, run);
if (ret == -EINTR || ret == -EAGAIN) {
void *get_mmap_addr(unsigned long size);
+void qemu_mutex_lock_iothread(void);
+void qemu_mutex_unlock_iothread(void);
+
/* Error handling. */
void QEMU_NORETURN hw_error(const char *fmt, ...)
}
}
-#define qemu_mutex_lock_iothread() do { } while (0)
-#define qemu_mutex_unlock_iothread() do { } while (0)
+void qemu_mutex_lock_iothread(void) {}
+void qemu_mutex_unlock_iothread(void) {}
void vm_stop(int reason)
{
qemu_mutex_unlock(&qemu_fair_mutex);
}
-static void qemu_mutex_lock_iothread(void)
+void qemu_mutex_lock_iothread(void)
{
if (kvm_enabled()) {
qemu_mutex_lock(&qemu_fair_mutex);
qemu_signal_lock(100);
}
-static void qemu_mutex_unlock_iothread(void)
+void qemu_mutex_unlock_iothread(void)
{
qemu_mutex_unlock(&qemu_global_mutex);
}