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 sync point to vmx
[palacios.git] / palacios / src / palacios / vmx.c
index e1b427a..11522f4 100644 (file)
@@ -32,6 +32,7 @@
 #include <palacios/vmx_io.h>
 #include <palacios/vmx_msr.h>
 #include <palacios/vmm_decoder.h>
+#include <palacios/vmm_barrier.h>
 
 #include <palacios/vmx_ept.h>
 #include <palacios/vmx_assist.h>
@@ -759,7 +760,9 @@ int v3_vmx_enter(struct guest_info * info) {
     v3_update_timers(info);
 
     if (vmcs_store() != vmx_info->vmcs_ptr_phys) {
+       vmcs_clear(vmx_info->vmcs_ptr_phys);
        vmcs_load(vmx_info->vmcs_ptr_phys);
+       vmx_info->state = VMX_UNLAUNCHED;
     }
 
     v3_vmx_restore_vmcs(info);
@@ -787,6 +790,7 @@ int v3_vmx_enter(struct guest_info * info) {
     check_vmcs_write(VMCS_TSC_OFFSET_HIGH, tsc_offset_high);
     check_vmcs_write(VMCS_TSC_OFFSET, tsc_offset_low);
 
+
     if (v3_update_vmcs_host_state(info)) {
        v3_enable_ints();
         PrintError("Could not write host state\n");
@@ -796,6 +800,7 @@ int v3_vmx_enter(struct guest_info * info) {
 
     if (vmx_info->state == VMX_UNLAUNCHED) {
        vmx_info->state = VMX_LAUNCHED;
+
        info->vm_info->run_state = VM_RUNNING;
        ret = v3_vmx_launch(&(info->vm_regs), info, &(info->ctrl_regs));
     } else {
@@ -918,7 +923,7 @@ int v3_start_vmx_guest(struct guest_info * info) {
 
        if (v3_vmx_enter(info) == -1) {
 
-  addr_t host_addr;
+           addr_t host_addr;
             addr_t linear_addr = 0;
             
             info->vm_info->run_state = VM_ERROR;
@@ -928,9 +933,7 @@ int v3_start_vmx_guest(struct guest_info * info) {
             v3_print_guest_state(info);
             
             V3_Print("VMX core %u\n", info->vcpu_id); 
-            
 
-            
             linear_addr = get_addr_linear(info, info->rip, &(info->segments.cs));
             
             if (info->mem_mode == PHYSICAL_MEM) {
@@ -952,6 +955,7 @@ int v3_start_vmx_guest(struct guest_info * info) {
            return -1;
        }
 
+       v3_wait_at_barrier(info);
 
 
        if (info->vm_info->run_state == VM_STOPPED) {