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 cpuid hooking
[palacios.git] / palacios / src / palacios / svm_handler.c
index a70b0dd..4c4aa2c 100644 (file)
 #include <palacios/vmm_decoder.h>
 #include <palacios/vmm_ctrl_regs.h>
 #include <palacios/svm_io.h>
-#include <palacios/svm_halt.h>
+#include <palacios/vmm_halt.h>
 #include <palacios/svm_pause.h>
 #include <palacios/svm_wbinvd.h>
 #include <palacios/vmm_intr.h>
 #include <palacios/vmm_emulator.h>
 #include <palacios/svm_msr.h>
-#include <palacios/vmm_profiler.h>
 #include <palacios/vmm_hypercall.h>
+#include <palacios/vmm_cpuid.h>
 #include <palacios/vmm_direct_paging.h>
 
+#ifdef CONFIG_TELEMETRY
+#include <palacios/vmm_telemetry.h>
+#endif
 
 
 int v3_handle_svm_exit(struct guest_info * info) {
@@ -97,9 +100,9 @@ int v3_handle_svm_exit(struct guest_info * info) {
     }
 
 
-#ifdef CONFIG_PROFILE_VMM
-    if (info->enable_profiler) {
-       rdtscll(info->profiler.start_time);
+#ifdef CONFIG_TELEMETRY
+    if (info->enable_telemetry) {
+       v3_telemetry_start_exit(info);
     }
 #endif
 
@@ -137,6 +140,7 @@ int v3_handle_svm_exit(struct guest_info * info) {
            break;
        }
        case VMEXIT_MSR:
+
            if (guest_ctrl->exit_info1 == 0) {
                if (v3_handle_msr_read(info) == -1) {
                    return -1;
@@ -151,6 +155,14 @@ int v3_handle_svm_exit(struct guest_info * info) {
            }
                
            break;
+
+       case VMEXIT_CPUID:
+           if (v3_handle_cpuid(info) == -1) {
+               PrintError("Error handling CPUID\n");
+               return -1;
+           }
+
+           break;
        case VMEXIT_CR0_WRITE: 
 #ifdef CONFIG_DEBUG_CTRL_REGS
            PrintDebug("CR0 Write\n");
@@ -262,7 +274,7 @@ int v3_handle_svm_exit(struct guest_info * info) {
 #ifdef CONFIG_DEBUG_HALT
            PrintDebug("Guest halted\n");
 #endif
-           if (v3_handle_svm_halt(info) == -1) {
+           if (v3_handle_halt(info) == -1) {
                return -1;
            }
            break;
@@ -320,10 +332,9 @@ int v3_handle_svm_exit(struct guest_info * info) {
     }
     // END OF SWITCH (EXIT_CODE)
 
-#ifdef CONFIG_PROFILE_VMM
-    if (info->enable_profiler) {
-       rdtscll(info->profiler.end_time);
-       v3_profile_exit(info, exit_code);
+#ifdef CONFIG_TELEMETRY
+    if (info->enable_telemetry) {
+       v3_telemetry_end_exit(info, exit_code);
     }
 #endif