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.


Added updated sleep/wakeup functionality
[palacios.git] / palacios / src / palacios / vmm.c
index 1d8cd07..de77277 100644 (file)
@@ -261,6 +261,22 @@ int v3_start_vm(struct v3_vm_info * vm, unsigned int cpu_mask) {
         return -1;
     }
 
+    
+    // Do not run if any core is using shadow paging and we are out of 4 GB bounds
+    for (i=0;i<vm->num_cores;i++) { 
+       if (vm->cores[i].shdw_pg_mode == SHADOW_PAGING) {
+           if ((vm->mem_map.base_region.host_addr + vm->mem_size ) >= 0x100000000ULL) {
+               PrintError("Base memory region exceeds 4 GB boundary with shadow paging enabled on core %d.\n",i);
+               PrintError("Any use of non-64 bit mode in the guest is likely to fail in this configuration.\n");
+               PrintError("If you would like to proceed anyway, remove this check and recompile Palacios.\n");
+               PrintError("Alternatively, change this VM to use nested paging.\n");
+               return -1;
+           }
+       }
+    }
+
+
+
     /// CHECK IF WE ARE MULTICORE ENABLED....
 
     V3_Print("V3 --  Starting VM (%u cores)\n", vm->num_cores);
@@ -457,7 +473,7 @@ int v3_move_vm_core(struct v3_vm_info * vm, int vcore_id, int target_cpu) {
 
 int v3_stop_vm(struct v3_vm_info * vm) {
 
-    if ((vm->run_state |= VM_RUNNING) && 
+    if ((vm->run_state != VM_RUNNING) && 
        (vm->run_state != VM_SIMULATING)) {
        PrintError("Tried to stop VM in invalid runstate (%d)\n", vm->run_state);
        return -1;
@@ -724,13 +740,13 @@ void v3_yield_cond(struct guest_info * info, int usec) {
        if (usec < 0) { 
            V3_Yield();
        } else {
-           V3_Yield_Timed(usec);
+           V3_Sleep(usec);
        }
 
         info->yield_start_cycle +=  info->vm_info->yield_cycle_period;
     }
 }
-
 
 /* 
  * unconditional cpu yield 
@@ -744,7 +760,7 @@ void v3_yield(struct guest_info * info, int usec) {
     if (usec < 0) { 
        V3_Yield();
     } else {
-       V3_Yield_Timed(usec);
+       V3_Sleep(usec);
     }
 
     if (info) {