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 invlpg support
[palacios.git] / palacios / src / palacios / svm_handler.c
index 7ac7be2..4ab4979 100644 (file)
@@ -7,7 +7,6 @@
 #include <palacios/vmm_intr.h>
 
 
-
 int handle_svm_exit(struct guest_info * info) {
   vmcb_ctrl_t * guest_ctrl = 0;
   vmcb_saved_state_t * guest_state = 0;
@@ -22,6 +21,7 @@ int handle_svm_exit(struct guest_info * info) {
   info->vm_regs.rsp = guest_state->rsp;
   info->vm_regs.rax = guest_state->rax;
 
+  info->cpl = guest_state->cpl;
 
 
   info->ctrl_regs.cr0 = guest_state->cr0;
@@ -36,7 +36,7 @@ int handle_svm_exit(struct guest_info * info) {
 
   exit_code = guest_ctrl->exit_code;
  
-  PrintDebug("SVM Returned: Exit Code: %x\n",exit_code); 
+  //PrintDebug("SVM Returned: Exit Code: %x\n",exit_code); 
   // PrintDebugVMCB((vmcb_t*)(info->vmm_data));
 
 
@@ -110,8 +110,15 @@ int handle_svm_exit(struct guest_info * info) {
       return -1;
     }
 
+  } else if (exit_code == VMEXIT_INVLPG) {
+    if (info->page_mode == SHADOW_PAGING) {
+      PrintDebug("Invlpg\n");
+      if (handle_shadow_invlpg(info) == -1) {
+       return -1;
+      }
+    }
+   
     /*
-      (exit_code == VMEXIT_INVLPG)    ||
       (exit_code == VMEXIT_INVLPGA)   || 
     */
     
@@ -226,6 +233,8 @@ int handle_svm_exit(struct guest_info * info) {
   guest_state->rflags = info->ctrl_regs.rflags;
 
 
+  guest_state->cpl = info->cpl;
+
   guest_state->rax = info->vm_regs.rax;
   guest_state->rip = info->rip;
   guest_state->rsp = info->vm_regs.rsp;