Call it as a special case for cpu 0 creation. This removes
a piece of kvm code from raw qemu.
Signed-off-by: Glauber Costa <[EMAIL PROTECTED]>
---
qemu/qemu-kvm.c | 21 ++++++++++++---------
qemu/qemu-kvm.h | 1 -
qemu/vl.c | 3 ---
3 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c
index cfdf90f..62d797d 100644
--- a/qemu/qemu-kvm.c
+++ b/qemu/qemu-kvm.c
@@ -436,15 +436,7 @@ static void *ap_main_loop(void *_env)
return NULL;
}
-void kvm_init_new_ap(int cpu, CPUState *env)
-{
- pthread_create(&vcpu_info[cpu].thread, NULL, ap_main_loop, env);
-
- while (vcpu_info[cpu].created == 0)
- qemu_cond_wait(&qemu_vcpu_cond);
-}
-
-int kvm_init_ap(void)
+static int kvm_init_ap(void)
{
#ifdef TARGET_I386
kvm_tpr_opt_setup();
@@ -455,6 +447,17 @@ int kvm_init_ap(void)
return 0;
}
+void kvm_init_new_ap(int cpu, CPUState *env)
+{
+ if (!cpu)
+ kvm_init_ap();
+
+ pthread_create(&vcpu_info[cpu].thread, NULL, ap_main_loop, env);
+
+ while (vcpu_info[cpu].created == 0)
+ qemu_cond_wait(&qemu_vcpu_cond);
+}
+
void qemu_kvm_notify_work(void)
{
uint64_t value = 1;
diff --git a/qemu/qemu-kvm.h b/qemu/qemu-kvm.h
index fd9d5d1..f8791b8 100644
--- a/qemu/qemu-kvm.h
+++ b/qemu/qemu-kvm.h
@@ -16,7 +16,6 @@ int kvm_main_loop(void);
int kvm_qemu_init(void);
int kvm_qemu_create_context(void);
void kvm_init_new_ap(int cpu, CPUState *env);
-int kvm_init_ap(void);
void kvm_qemu_destroy(void);
void kvm_load_registers(CPUState *env);
void kvm_save_registers(CPUState *env);
diff --git a/qemu/vl.c b/qemu/vl.c
index ad4d24b..9ec3c61 100644
--- a/qemu/vl.c
+++ b/qemu/vl.c
@@ -10080,9 +10080,6 @@ int main(int argc, char **argv)
}
}
- if (kvm_enabled())
- kvm_init_ap();
-
machine->init(ram_size, vga_ram_size, boot_devices, ds,
kernel_filename, kernel_cmdline, initrd_filename, cpu_model);
--
1.5.5.1
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html