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.


symbiotic fixups
[palacios.git] / palacios / src / palacios / vmm.c
index fcc6ea5..1571c48 100644 (file)
@@ -174,9 +174,17 @@ void v3_yield_cond(struct guest_info * info) {
     }
 }
 
+/* 
+ * unconditional cpu yield 
+ * if the yielding thread is a guest context, the guest quantum is reset on resumption 
+ * Non guest context threads should call this function with a NULL argument
+ */
 void v3_yield(struct guest_info * info) {
     V3_Yield();
-    rdtscll(info->yield_start_cycle);
+
+    if (info) {
+       rdtscll(info->yield_start_cycle);
+    }
 }
 
 
@@ -188,3 +196,25 @@ void v3_interrupt_cpu(struct guest_info * info, int logical_cpu) {
        (os_hooks)->interrupt_cpu(info, logical_cpu);
     }
 }
+
+
+
+int v3_vm_enter(struct guest_info * info) {
+    switch (v3_cpu_types[info->cpu_id]) {
+#ifdef CONFIG_SVM
+       case V3_SVM_CPU:
+       case V3_SVM_REV3_CPU:
+           return v3_svm_enter(info);
+           break;
+#endif
+#if CONFIG_VMX && 0
+       case V3_VMX_CPU:
+       case V3_VMX_EPT_CPU:
+           return v3_vmx_enter(info);
+           break;
+#endif
+       default:
+           PrintError("Attemping to enter a guest on an invalid CPU\n");
+           return -1;
+    }
+}