From: Jack Lange Date: Tue, 1 Nov 2011 23:42:35 +0000 (-0400) Subject: moved VM runstate settings to avoid race condition X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=commitdiff_plain;h=67a6b30f915c83005bf0e3ae4a2d9f9598b10013;p=palacios-OLD.git moved VM runstate settings to avoid race condition --- diff --git a/palacios/src/palacios/svm.c b/palacios/src/palacios/svm.c index 4614e9e..4b7267e 100644 --- a/palacios/src/palacios/svm.c +++ b/palacios/src/palacios/svm.c @@ -649,7 +649,6 @@ int v3_start_svm_guest(struct guest_info * info) { if (info->vcpu_id == 0) { info->core_run_state = CORE_RUNNING; - info->vm_info->run_state = VM_RUNNING; } else { PrintDebug("SVM core %u (on %u): Waiting for core initialization\n", info->vcpu_id, info->pcpu_id); diff --git a/palacios/src/palacios/vmm.c b/palacios/src/palacios/vmm.c index f86130f..5b2c8d1 100644 --- a/palacios/src/palacios/vmm.c +++ b/palacios/src/palacios/vmm.c @@ -270,6 +270,8 @@ int v3_start_vm(struct v3_vm_info * vm, unsigned int cpu_mask) { return -1; } + vm->run_state = VM_RUNNING; + // Spawn off threads for each core. // We work backwards, so that core 0 is always started last. for (i = 0, vcore_id = vm->num_cores - 1; (i < MAX_CORES) && (vcore_id >= 0); i++) { diff --git a/palacios/src/palacios/vmx.c b/palacios/src/palacios/vmx.c index ec59df0..ee12c08 100644 --- a/palacios/src/palacios/vmx.c +++ b/palacios/src/palacios/vmx.c @@ -810,8 +810,6 @@ int v3_vmx_enter(struct guest_info * info) { if (vmx_info->state == VMX_UNLAUNCHED) { vmx_info->state = VMX_LAUNCHED; - - info->vm_info->run_state = VM_RUNNING; ret = v3_vmx_launch(&(info->vm_regs), info, &(info->ctrl_regs)); } else { V3_ASSERT(vmx_info->state != VMX_UNLAUNCHED); @@ -904,7 +902,6 @@ int v3_start_vmx_guest(struct guest_info * info) { if (info->vcpu_id == 0) { info->core_run_state = CORE_RUNNING; - info->vm_info->run_state = VM_RUNNING; } else { PrintDebug("VMX core %u: Waiting for core initialization\n", info->vcpu_id);