From 8d2ba1fb9c8e7006e10d71fa51a020977f14c8b0 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Sat, 27 Jun 2009 09:24:58 +0200 Subject: kvm: Rework VCPU synchronization During startup and after reset we have to synchronize user space to the in-kernel KVM state. Namely, we need to transfer the VCPU registers when they change due to VCPU as well as APIC reset. This patch refactors the required hooks so that kvm_init_vcpu registers its own per-VCPU reset handler and adds a cpu_synchronize_state to the APIC reset. That way we no longer depend on the new reset order (and can drop this disliked interface again) and we can even drop a KVM hook in main(). Signed-off-by: Jan Kiszka Signed-off-by: Anthony Liguori --- vl.c | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'vl.c') diff --git a/vl.c b/vl.c index eb2449a133..c84e2d1bc9 100644 --- a/vl.c +++ b/vl.c @@ -6057,17 +6057,6 @@ int main(int argc, char **argv, char **envp) current_machine = machine; - /* Set KVM's vcpu state to qemu's initial CPUState. */ - if (kvm_enabled()) { - int ret; - - ret = kvm_sync_vcpus(); - if (ret < 0) { - fprintf(stderr, "failed to initialize vcpus\n"); - exit(1); - } - } - /* init USB devices */ if (usb_enabled) { for(i = 0; i < usb_devices_index; i++) { -- cgit v1.2.3-55-g7522