From: Peter Dinda Date: Mon, 9 Jun 2014 23:01:46 +0000 (-0500) Subject: Minor fixes X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=10446dafcbc15a8aa1639c52b5996f814ed37f27 Minor fixes - friendlier yield in vtime - VMM launch observes started vcores (from checkpoint resume with >1 vcores) --- diff --git a/palacios/src/extensions/ext_vtime.c b/palacios/src/extensions/ext_vtime.c index 6fd9931..6dfe5d1 100644 --- a/palacios/src/extensions/ext_vtime.c +++ b/palacios/src/extensions/ext_vtime.c @@ -106,7 +106,8 @@ int v3_adjust_time(struct guest_info * info) { old_guest_time = v3_get_guest_time(time_state); while (target_host_time > host_time) { - v3_yield(info); + // this will immediately yield if there is noone to yield to. + v3_yield(info,-1); host_time = v3_get_host_time(time_state); } diff --git a/palacios/src/palacios/vmm.c b/palacios/src/palacios/vmm.c index 88fa79a..ac91873 100644 --- a/palacios/src/palacios/vmm.c +++ b/palacios/src/palacios/vmm.c @@ -387,7 +387,14 @@ int v3_start_vm(struct v3_vm_info * vm, unsigned int cpu_mask) { PrintDebug(vm, VCORE_NONE, "run: core=%u, func=0x%p, arg=0x%p, name=%s\n", core->pcpu_id, start_core, core, core->exec_name); - core->core_run_state = CORE_STOPPED; // core zero will turn itself on + if (core->core_run_state==CORE_INVALID) { + // launch of a fresh VM + core->core_run_state = CORE_STOPPED; + // core zero will turn itself on + } else { + // this is a resume - use whatever its current run_state is + } + core->core_thread = V3_CREATE_THREAD_ON_CPU(core->pcpu_id, start_core, core, core->exec_name); if (core->core_thread == NULL) {