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.


Timed yielding in vmm_halt to avoid pegging CPU
[palacios.git] / palacios / src / palacios / vmx_assist.c
index d7d84ea..01a2f6f 100644 (file)
 #include <palacios/vmx.h>
 #include <palacios/vmm_ctrl_regs.h>
 
-#ifndef CONFIG_DEBUG_VMX
+#ifndef V3_CONFIG_DEBUG_VMX
 #undef PrintDebug
 #define PrintDebug(fmt, args...)
 #endif
 
-#define VMXASSIST_GDT     0x10000
-#define VMXASSIST_TSS     0x40000
-#define VMXASSIST_START   0xd0000
-#define VMXASSIST_1to1_PT 0xde000 // We'll shove this at the end, and pray to god VMXASSIST doesn't mess with it
+
 
 
 #define VMXASSIST_MAGIC        0x17101966
@@ -134,7 +131,7 @@ int v3_vmxassist_ctx_switch(struct guest_info * info) {
         return -1;
     }
 
-    if (vmx_info->assist_state == VMXASSIST_DISABLED) {
+    if (vmx_info->assist_state == VMXASSIST_OFF) {
         
         /* Save the old Context */
        vmx_save_world_ctx(info, old_ctx);
@@ -142,13 +139,13 @@ int v3_vmxassist_ctx_switch(struct guest_info * info) {
         /* restore new context, vmxassist should launch the bios the first time */
         vmx_restore_world_ctx(info, new_ctx);
 
-        vmx_info->assist_state = VMXASSIST_ENABLED;
+        vmx_info->assist_state = VMXASSIST_ON;
 
-    } else if (vmx_info->assist_state == VMXASSIST_ENABLED) {
+    } else if (vmx_info->assist_state == VMXASSIST_ON) {
         /* restore old context */
        vmx_restore_world_ctx(info, old_ctx);
 
-        vmx_info->assist_state = VMXASSIST_DISABLED;
+        vmx_info->assist_state = VMXASSIST_OFF;
     }
 
     return 0;
@@ -258,6 +255,7 @@ int v3_vmxassist_init(struct guest_info * core, struct vmx_data * vmx_state) {
 
     ((struct cr0_32 *)&(core->shdw_pg_state.guest_cr0))->pe = 1;
     ((struct cr0_32 *)&(core->shdw_pg_state.guest_cr0))->wp = 1;
+    ((struct cr0_32 *)&(core->shdw_pg_state.guest_cr0))->ne = 1;
    
 
     // Setup segment registers
@@ -378,7 +376,7 @@ int v3_vmxassist_init(struct guest_info * core, struct vmx_data * vmx_state) {
        memcpy((void *)vmxassist_dst, v3_vmxassist_start, v3_vmxassist_end - v3_vmxassist_start);
 
 
-       vmx_state->assist_state = VMXASSIST_DISABLED;
+       vmx_state->assist_state = VMXASSIST_OFF;
     }