X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmx.c;h=6fd1f8d05956efe047dbcfb5a6586b30795b1593;hb=02d617c8f625ad5da6c4c9b78b224e84baac5d08;hp=d6471a1dac5f16b2debcff2dcee1b0f9f461aa19;hpb=acaadd79c597c8d5180fbfbec79c01fef3dff003;p=palacios.git diff --git a/palacios/src/palacios/vmx.c b/palacios/src/palacios/vmx.c index d6471a1..6fd1f8d 100644 --- a/palacios/src/palacios/vmx.c +++ b/palacios/src/palacios/vmx.c @@ -966,7 +966,7 @@ int v3_vmx_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 late after being in the VM so that as much // of the time in the VM is accounted for as possible. Also do it before @@ -1027,6 +1027,10 @@ int v3_vmx_enter(struct guest_info * info) { uint64_t entry_tsc = 0; uint64_t exit_tsc = 0; +#ifdef V3_CONFIG_PMU_TELEMETRY + v3_pmu_telemetry_enter(info); +#endif + if (vmx_info->state == VMX_UNLAUNCHED) { vmx_info->state = VMX_LAUNCHED; rdtscll(entry_tsc); @@ -1041,6 +1045,10 @@ int v3_vmx_enter(struct guest_info * info) { } guest_cycles = exit_tsc - entry_tsc; + +#ifdef V3_CONFIG_PMU_TELEMETRY + v3_pmu_telemetry_exit(info); +#endif } // PrintDebug(info->vm_info, info, "VMX Exit: ret=%d\n", ret); @@ -1135,7 +1143,7 @@ int v3_vmx_enter(struct guest_info * info) { v3_enable_ints(); // Conditionally yield the CPU if the timeslice has expired - v3_yield_cond(info,-1); + v3_schedule(info); v3_advance_time(info, NULL); v3_update_timers(info); @@ -1190,6 +1198,10 @@ int v3_start_vmx_guest(struct guest_info * info) { v3_start_time(info); +#ifdef V3_CONFIG_PMU_TELEMETRY + v3_pmu_telemetry_start(info); +#endif + while (1) { if (info->vm_info->run_state == VM_STOPPED) { @@ -1246,6 +1258,10 @@ int v3_start_vmx_guest(struct guest_info * info) { } +#ifdef V3_CONFIG_PMU_TELEMETRY + v3_pmu_telemetry_end(info); +#endif + return 0; }