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.


Fixes to interrupt (IRQ and VIRQ) injection logic:
[palacios.git] / palacios / src / palacios / svm.c
index f60acda..c226e68 100644 (file)
@@ -527,7 +527,11 @@ static int update_irq_entry_state(struct guest_info * info) {
     } else {
        switch (v3_intr_pending(info)) {
            case V3_EXTERNAL_IRQ: {
-               uint32_t irq = v3_get_intr(info);
+               int irq = v3_get_intr(info); 
+
+               if (irq<0) {
+                 break;
+               }
 
                guest_ctrl->guest_ctrl.V_IRQ = 1;
                guest_ctrl->guest_ctrl.V_INTR_VECTOR = irq;
@@ -616,7 +620,7 @@ int v3_svm_enter(struct guest_info * info) {
     uint64_t guest_cycles = 0;
 
     // Conditionally yield the CPU if the timeslice has expired
-    v3_yield_cond(info,-1);
+    v3_schedule(info);
 
     // Update timer devices after being in the VM before doing 
     // IRQ updates, so that any interrupts they raise get seen 
@@ -694,12 +698,29 @@ int v3_svm_enter(struct guest_info * info) {
        uint64_t entry_tsc = 0;
        uint64_t exit_tsc = 0;
        
+#ifdef V3_CONFIG_PWRSTAT_TELEMETRY
+       v3_pwrstat_telemetry_enter(info);
+#endif
+
+#ifdef V3_CONFIG_PMU_TELEMETRY
+       v3_pmu_telemetry_enter(info);
+#endif
+
+
        rdtscll(entry_tsc);
 
        v3_svm_launch((vmcb_t *)V3_PAddr(info->vmm_data), &(info->vm_regs), (vmcb_t *)host_vmcbs[V3_Get_CPU()]);
 
        rdtscll(exit_tsc);
 
+#ifdef V3_CONFIG_PMU_TELEMETRY
+       v3_pmu_telemetry_exit(info);
+#endif
+
+#ifdef V3_CONFIG_PWRSTAT_TELEMETRY
+       v3_pwrstat_telemetry_exit(info);
+#endif
+
        guest_cycles = exit_tsc - entry_tsc;
     }
 
@@ -761,7 +782,7 @@ int v3_svm_enter(struct guest_info * info) {
     v3_stgi();
  
     // Conditionally yield the CPU if the timeslice has expired
-    v3_yield_cond(info,-1);
+    v3_schedule(info);
 
     // This update timers is for time-dependent handlers
     // if we're slaved to host time
@@ -829,6 +850,14 @@ int v3_start_svm_guest(struct guest_info * info) {
     
     v3_start_time(info);
 
+#ifdef V3_CONFIG_PMU_TELEMETRY
+    v3_pmu_telemetry_start(info);
+#endif
+
+#ifdef V3_CONFIG_PWRSTAT_TELEMETRY
+    v3_pwrstat_telemetry_start(info);
+#endif
+
     while (1) {
 
        if (info->vm_info->run_state == VM_STOPPED) {
@@ -892,6 +921,13 @@ int v3_start_svm_guest(struct guest_info * info) {
        
     }
 
+#ifdef V3_CONFIG_PMU_TELEMETRY
+    v3_pmu_telemetry_end(info);
+#endif
+
+#ifdef V3_CONFIG_PWRSTAT_TELEMETRY
+    v3_pwrstat_telemetry_end(info);
+#endif
     // Need to take down the other cores on error... 
 
     return 0;