X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_scheduler.c;h=cac34252620e65074e3c12866e07e8948a6db0e1;hb=cc147585559de5e37d51904da4bea40347e34937;hp=f4366cd5bd9bec5eae0b754eae2c4f311985d594;hpb=36a068547bf2342c7b7a29058df4cc8e0ff56291;p=palacios.git diff --git a/palacios/src/palacios/vmm_scheduler.c b/palacios/src/palacios/vmm_scheduler.c index f4366cd..cac3425 100644 --- a/palacios/src/palacios/vmm_scheduler.c +++ b/palacios/src/palacios/vmm_scheduler.c @@ -94,12 +94,13 @@ int V3_enable_scheduler() { scheduler = v3_scheduler_lookup(default_strategy); } - PrintDebug(VM_NONE, VCORE_NONE,"Scheduler %s found",scheduler->name); - if (!scheduler) { PrintError(VM_NONE, VCORE_NONE,"Specified Palacios scheduler \"%s\" not found.\n", default_strategy); return -1; } + + PrintDebug(VM_NONE, VCORE_NONE,"Scheduler %s found",scheduler->name); + if (scheduler->init) { return scheduler->init(); } else { @@ -196,9 +197,7 @@ void host_sched_schedule(struct guest_info *core) V3_Yield(); - uint64_t yield_start_cycle = (uint64_t) core->sched_priv_data; - yield_start_cycle += (uint64_t)core->vm_info->sched_priv_data; - core->sched_priv_data = (void *)yield_start_cycle; + core->sched_priv_data = (void*)v3_get_host_time(&(core->time_state)); } } @@ -212,16 +211,14 @@ void host_sched_schedule(struct guest_info *core) * usec >=0 => the timed yield is used, which also usually implies interruptible */ void host_sched_yield(struct guest_info * core, int usec) { - uint64_t yield_start_cycle; + if (usec < 0) { V3_Yield(); } else { V3_Sleep(usec); } - if(core){ - yield_start_cycle = (uint64_t) core->sched_priv_data - + (uint64_t)core->vm_info->sched_priv_data; - core->sched_priv_data = (void *)yield_start_cycle; + if (core){ + core->sched_priv_data = (void*)v3_get_host_time(&(core->time_state)); } }