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.


fix barrier hang w/ unitialized secondary cores
Jack Lange [Tue, 20 Sep 2011 19:40:31 +0000 (15:40 -0400)]
palacios/src/palacios/svm.c
palacios/src/palacios/vmm_barrier.c
palacios/src/palacios/vmx.c

index a52b4d0..115e19c 100644 (file)
@@ -700,6 +700,9 @@ int v3_start_svm_guest(struct guest_info * info) {
        }
 
        PrintDebug("SVM core %u(on %u) initialized\n", info->vcpu_id, info->pcpu_id);
+
+       // We'll be paranoid about race conditions here
+       v3_wait_at_barrier(info);
     } 
 
     PrintDebug("SVM core %u(on %u): I am starting at CS=0x%x (base=0x%p, limit=0x%x),  RIP=0x%p\n", 
index ab0aae4..7718fc8 100644 (file)
@@ -104,6 +104,14 @@ int v3_raise_barrier(struct v3_vm_info * vm_info, struct guest_info * local_core
        all_blocked = 1;
 
        for (i = 0; i < vm_info->num_cores; i++) {
+           
+           // Tricky: If a core is not running then it is safe to ignore it. 
+           // Whenever we transition a core to the RUNNING state we MUST immediately wait on the barrier. 
+           // TODO: Wrap the state transitions in functions that do this automatically
+           if (vm_info->cores[i].core_run_state != CORE_RUNNING) {
+               continue;
+           }
+
            if (v3_bitmap_check(&(barrier->cpu_map), i) == 0) {
                // There is still a core that is not waiting at the barrier
                all_blocked = 0;
@@ -157,6 +165,8 @@ int v3_wait_at_barrier(struct guest_info * core) {
        return 0;
     }
 
+    V3_Print("Core %d waiting at barrier\n", core->vcpu_id);
+
     /*  Barrier has been activated. 
      *  Wait here until it's lowered
      */
@@ -164,6 +174,7 @@ int v3_wait_at_barrier(struct guest_info * core) {
     
     // set cpu bit in barrier bitmap
     v3_bitmap_set(&(barrier->cpu_map), core->vcpu_id);
+    V3_Print("Core %d bit set as waiting\n", core->vcpu_id);
 
     // wait for cpu bit to clear
     while (v3_bitmap_check(&(barrier->cpu_map), core->vcpu_id) == 1) {
index c7c66c5..e733eb5 100644 (file)
@@ -955,6 +955,9 @@ int v3_start_vmx_guest(struct guest_info * info) {
         }
        
        PrintDebug("VMX core %u initialized\n", info->vcpu_id);
+
+       // We'll be paranoid about race conditions here
+       v3_wait_at_barrier(info);
     }