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.


Addition of basic multiboot functionality plus refactor of HVM
[palacios.git] / palacios / src / palacios / svm.c
index d1125ee..0e37c4c 100644 (file)
 
 #include <palacios/vmm_sprintf.h>
 
+#ifdef V3_CONFIG_MEM_TRACK
+#include <palacios/vmm_mem_track.h>
+#endif 
+
 #ifdef V3_CONFIG_TM_FUNC
 #include <extensions/trans_mem.h>
 #endif
@@ -633,12 +637,17 @@ int v3_svm_enter(struct guest_info * info) {
     // Conditionally yield the CPU if the timeslice has expired
     v3_schedule(info);
 
+#ifdef V3_CONFIG_MEM_TRACK
+    v3_mem_track_entry(info);
+#endif 
+
     // Update timer devices after being in the VM before doing 
     // IRQ updates, so that any interrupts they raise get seen 
     // immediately.
     v3_advance_time(info, NULL);
     v3_update_timers(info);
 
+
     // disable global interrupts for vm state transition
     v3_clgi();
 
@@ -799,6 +808,7 @@ int v3_svm_enter(struct guest_info * info) {
 
     // reenable global interrupts after vm exit
     v3_stgi();
+
  
     // Conditionally yield the CPU if the timeslice has expired
     v3_schedule(info);
@@ -808,6 +818,7 @@ int v3_svm_enter(struct guest_info * info) {
     v3_advance_time(info, NULL);
     v3_update_timers(info);
 
+
     {
        int ret = v3_handle_svm_exit(info, exit_code, exit_info1, exit_info2);
        
@@ -823,6 +834,10 @@ int v3_svm_enter(struct guest_info * info) {
        v3_handle_timeouts(info, guest_cycles);
     }
 
+#ifdef V3_CONFIG_MEM_TRACK
+    v3_mem_track_exit(info);
+#endif 
+
 
     return 0;
 }
@@ -834,6 +849,25 @@ int v3_start_svm_guest(struct guest_info * info) {
 
     PrintDebug(info->vm_info, info, "Starting SVM core %u (on logical core %u)\n", info->vcpu_id, info->pcpu_id);
 
+
+#ifdef V3_CONFIG_MULTIBOOT
+    if (v3_setup_multiboot_core_for_boot(info)) { 
+       PrintError(info->vm_info, info, "Failed to setup Multiboot core...\n");
+       return -1;
+    }
+#endif
+
+#ifdef V3_CONFIG_HVM
+    if (v3_setup_hvm_hrt_core_for_boot(info)) { 
+       PrintError(info->vm_info, info, "Failed to setup HRT core...\n");
+       return -1;
+    }
+#endif
+
+           
+
+
     while (1) {
 
        if (info->core_run_state == CORE_STOPPED) {
@@ -883,7 +917,6 @@ int v3_start_svm_guest(struct guest_info * info) {
            info->core_run_state = CORE_STOPPED;
            break;
        }
-       
 
 #ifdef V3_CONFIG_PMU_TELEMETRY
        v3_pmu_telemetry_start(info);