kvm: Mark VCPU state dirty on creation
This avoids that early cpu_synchronize_state calls try to retrieve an uninitialized state from the kernel. That even causes a deadlock if io-thread is enabled. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
This commit is contained in:
parent
4601f7b04c
commit
d841b6c4f1
@ -211,6 +211,7 @@ int kvm_init_vcpu(CPUState *env)
|
|||||||
|
|
||||||
env->kvm_fd = ret;
|
env->kvm_fd = ret;
|
||||||
env->kvm_state = s;
|
env->kvm_state = s;
|
||||||
|
env->kvm_vcpu_dirty = 1;
|
||||||
|
|
||||||
mmap_size = kvm_ioctl(s, KVM_GET_VCPU_MMAP_SIZE, 0);
|
mmap_size = kvm_ioctl(s, KVM_GET_VCPU_MMAP_SIZE, 0);
|
||||||
if (mmap_size < 0) {
|
if (mmap_size < 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user