Patchwork [v4,10/10] qemu-kvm: Bring qemu_init_vcpu back home

login
register
mail settings
Submitter Jan Kiszka
Date March 1, 2010, 5:17 p.m.
Message ID <190fe78f4c8c0a830189a6602d64ea463e0f2be8.1267463833.git.jan.kiszka@siemens.com>
Download mbox | patch
Permalink /patch/46575/
State New
Headers show

Comments

Jan Kiszka - March 1, 2010, 5:17 p.m.
There is no need for the this hack anymore, initialization is now robust
against reordering as it doesn't try to write the VCPU state on its own.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 hw/pc.c              |    5 -----
 target-i386/helper.c |    2 ++
 2 files changed, 2 insertions(+), 5 deletions(-)

Patch

diff --git a/hw/pc.c b/hw/pc.c
index d819fca..0aebae9 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -787,11 +787,6 @@  CPUState *pc_new_cpu(const char *cpu_model)
     } else {
         qemu_register_reset((QEMUResetHandler*)cpu_reset, env);
     }
-
-    /* kvm needs this to run after the apic is initialized. Otherwise,
-     * it can access invalid state and crash.
-     */
-    qemu_init_vcpu(env);
     return env;
 }
 
diff --git a/target-i386/helper.c b/target-i386/helper.c
index 73381e2..e595a3e 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -2285,6 +2285,8 @@  CPUX86State *cpu_x86_init(const char *cpu_model)
     }
     mce_init(env);
 
+    qemu_init_vcpu(env);
+
     return env;
 }