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 barrier locking to the core migration functionality
[palacios.git] / palacios / src / palacios / svm.c
index f366a76..1bf16cc 100644 (file)
@@ -1,4 +1,3 @@
-
 /* 
  * This file is part of the Palacios Virtual Machine Monitor developed
  * by the V3VEE Project with funding from the United States National 
@@ -36,6 +35,8 @@
 #include <palacios/svm_msr.h>
 
 #include <palacios/vmm_rbtree.h>
+#include <palacios/vmm_barrier.h>
+
 
 #include <palacios/vmm_direct_paging.h>
 
@@ -86,11 +87,12 @@ static int v3_svm_handle_efer_write(struct guest_info * core, uint_t msr, struct
     int status;
 
     // Call arch-independent handler
-    if ((status = v3_handle_efer_write(core, msr, src, priv_data)) != 0)
+    if ((status = v3_handle_efer_write(core, msr, src, priv_data)) != 0) {
        return status;
+    }
 
     // SVM-specific code
-    if (core->shdw_pg_mode == NESTED_PAGING) {
+    {
        // Ensure that hardware visible EFER.SVME bit is set (SVM Enable)
        struct efer_64 * hw_efer = (struct efer_64 *)&(core->ctrl_regs.efer);
        hw_efer->svme = 1;
@@ -545,6 +547,7 @@ int v3_svm_enter(struct guest_info * info) {
     v3_time_enter_vm(info);
     guest_ctrl->TSC_OFFSET = v3_tsc_host_offset(&info->time_state);
 
+
     //V3_Print("Calling v3_svm_launch\n");
 
     v3_svm_launch((vmcb_t *)V3_PAddr(info->vmm_data), &(info->vm_regs), (vmcb_t *)host_vmcbs[V3_Get_CPU()]);
@@ -691,6 +694,8 @@ int v3_start_svm_guest(struct guest_info * info) {
            break;
        }
 
+       v3_wait_at_barrier(info);
+
 
        if (info->vm_info->run_state == VM_STOPPED) {
            info->core_run_state = CORE_STOPPED;