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 functionality for MONITOR and MWAIT instructions on SVM and VMX:
[palacios.git] / palacios / src / palacios / svm_handler.c
index b270907..d0adffc 100644 (file)
@@ -25,6 +25,7 @@
 #include <palacios/vmm_ctrl_regs.h>
 #include <palacios/svm_io.h>
 #include <palacios/vmm_halt.h>
+#include <palacios/vmm_mwait.h>
 #include <palacios/svm_pause.h>
 #include <palacios/svm_wbinvd.h>
 #include <palacios/vmm_intr.h>
@@ -165,6 +166,25 @@ int v3_handle_svm_exit(struct guest_info * info, addr_t exit_code, addr_t exit_i
                return -1;
            }
            break;
+
+       case SVM_EXIT_CR8_WRITE:
+#ifdef V3_CONFIG_DEBUG_CTRL_REGS
+           PrintDebug("CR8 Read\n");
+#endif
+           if (v3_handle_cr8_read(info) == -1) {
+               return -1;
+           }
+           break;
+
+       case SVM_EXIT_CR8_READ:
+#ifdef V3_CONFIG_DEBUG_CTRL_REGS
+           PrintDebug("CR8 Read\n");
+#endif
+           if (v3_handle_cr8_read(info) == -1) {
+               return -1;
+           }
+           break;
+
        case SVM_EXIT_EXCP14: {
            addr_t fault_addr = exit_info2;
            pf_error_t * error_code = (pf_error_t *)&(exit_info1);
@@ -238,6 +258,26 @@ int v3_handle_svm_exit(struct guest_info * info, addr_t exit_code, addr_t exit_i
                return -1;
            }
            break;
+
+       case SVM_EXIT_MONITOR:
+#ifdef V3_CONFIG_DEBUG_MWAIT
+           PrintDebug("Guest issuing MONITOR\n");
+#endif
+           if (v3_handle_monitor(info) == -1) { 
+               return -1;
+           }
+           break;
+
+       case SVM_EXIT_MWAIT:
+       case SVM_EXIT_MWAIT_CONDITIONAL:
+#ifdef V3_CONFIG_DEBUG_MWAIT
+           PrintDebug("Guest issuing MWAIT\n");
+#endif
+           if (v3_handle_mwait(info) == -1) { 
+               return -1;
+           }
+           break;
+
        case SVM_EXIT_PAUSE:
            //      PrintDebug("Guest paused\n");
            if (v3_handle_svm_pause(info) == -1) { 
@@ -256,7 +296,7 @@ int v3_handle_svm_exit(struct guest_info * info, addr_t exit_code, addr_t exit_i
 #ifdef V3_CONFIG_DEBUG_TIME
            PrintDebug("RDTSC/RDTSCP\n");
 #endif 
-           if (v3_dispatch_exit_hook(info, V3_EXIT_RDTSC, NULL) == -1) {
+           if (v3_handle_rdtsc(info) == -1) {
                PrintError("Error Handling RDTSC instruction\n");
                return -1;
            }
@@ -265,7 +305,7 @@ int v3_handle_svm_exit(struct guest_info * info, addr_t exit_code, addr_t exit_i
 #ifdef V3_CONFIG_DEBUG_TIME
            PrintDebug("RDTSCP\n");
 #endif 
-           if (v3_dispatch_exit_hook(info, V3_EXIT_RDTSCP, NULL) == -1) {
+           if (v3_handle_rdtscp(info) == -1) {
                PrintError("Error handling RDTSCP instruction\n");
                return -1;
            }