Patchwork [06/15] kvm: Mark VCPU state dirty on creation

login
register
mail settings
Submitter Jan Kiszka
Date March 4, 2011, 10:20 a.m.
Message ID <3104814a539ba37eddc0b2fdc50f6c2ec0a45bb3.1299233998.git.jan.kiszka@siemens.com>
Download mbox | patch
Permalink /patch/85400/
State New
Headers show

Comments

Jan Kiszka - March 4, 2011, 10:20 a.m.
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>
---
 kvm-all.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Patch

diff --git a/kvm-all.c b/kvm-all.c
index c460d45..07a1a9c 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -211,6 +211,7 @@  int kvm_init_vcpu(CPUState *env)
 
     env->kvm_fd = ret;
     env->kvm_state = s;
+    env->kvm_vcpu_dirty = 1;
 
     mmap_size = kvm_ioctl(s, KVM_GET_VCPU_MMAP_SIZE, 0);
     if (mmap_size < 0) {