Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Still working on timer updates, heading towards being able to have a CPU
[palacios.releases.git] / palacios / src / palacios / vmm.c
index dae7d34..9061ab7 100644 (file)
@@ -63,7 +63,7 @@ static void init_cpu(void * arg) {
     } else 
 #endif
     {
-       PrintError("CPU has no virtualization Extensions\n");
+       PrintError("CPU has no virtualizationExtensions\n");
     }
 }
 
@@ -156,7 +156,7 @@ static int start_core(void *p)
            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
@@ -203,6 +203,9 @@ int v3_start_vm(struct v3_vm_info * vm, unsigned int cpu_mask) {
        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);
@@ -217,6 +220,9 @@ int v3_start_vm(struct v3_vm_info * vm, unsigned int cpu_mask) {
        }
     }
 
+    // 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 (!os_hooks->start_thread_on_cpu(0,start_core,&(vm->cores[0]),tname)) { 
@@ -271,7 +277,7 @@ v3_cpu_mode_t v3_get_host_cpu_mode() {
 
 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)) {
 
@@ -280,7 +286,7 @@ void v3_yield_cond(struct guest_info * info) {
          (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);
     }
 }
 
@@ -294,7 +300,7 @@ void v3_yield(struct guest_info * info) {
     V3_Yield();
 
     if (info) {
-       rdtscll(info->yield_start_cycle);
+       info->yield_start_cycle = v3_get_host_time(&info->time_state);
     }
 }