} else
#endif
{
- PrintError("CPU has no virtualization Extensions\n");
+ PrintError("CPU has no virtualizationExtensions\n");
}
}
break;
#endif
default:
- PrintError("Attemping to enter a guest on an invalid CPU\n");
+ PrintError("Attempting to enter a guest on an invalid CPU\n");
return -1;
}
// should not happen
proc_to_use=get_next_core(cpu_mask,last_proc);
last_proc=proc_to_use;
+ // vm->cores[i].cpu_id=i;
+ // vm->cores[i].physical_cpu_id=proc_to_use;
+
PrintDebug("Starting virtual core %u on logical core %u\n",i,proc_to_use);
sprintf(tname,"core%u",i);
}
}
+ // vm->cores[0].cpu_id=0;
+ // vm->cores[0].physical_cpu_id=0;
+
// Finally launch the BSP on core 0
sprintf(tname,"core%u",0);
+
+#if CONFIG_LINUX
+ if (vm->num_cores==1) {
+ start_core(&(vm->cores[0]));
+ return -1;
+ } else {
+ if (!os_hooks->start_thread_on_cpu(0,start_core,&(vm->cores[0]),tname)) {
+ PrintError("Thread launch failed\n");
+ return -1;
+ }
+ }
+#else
if (!os_hooks->start_thread_on_cpu(0,start_core,&(vm->cores[0]),tname)) {
PrintError("Thread launch failed\n");
return -1;
}
+#endif
return 0;
void v3_yield_cond(struct guest_info * info) {
uint64_t cur_cycle;
- rdtscll(cur_cycle);
+ cur_cycle = v3_get_host_time(&info->time_state);
if (cur_cycle > (info->yield_start_cycle + info->vm_info->yield_cycle_period)) {
(void *)cur_cycle, (void *)info->yield_start_cycle, (void *)info->yield_cycle_period);
*/
V3_Yield();
- rdtscll(info->yield_start_cycle);
+ info->yield_start_cycle = v3_get_host_time(&info->time_state);
}
}
V3_Yield();
if (info) {
- rdtscll(info->yield_start_cycle);
+ info->yield_start_cycle = v3_get_host_time(&info->time_state);
}
}