X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmx_handler.c;h=e5da7622e724c3dd556e27d0b51b1153d182eb95;hb=619e5ea2fa938caa2ea987a0c3398e8f7250a80e;hp=1da8a586cae9e3d05f9f947ef42ee9c42033f3c9;hpb=5c5dfe422e57ac9833dd3ed3a7d0f5c39557b86c;p=palacios-OLD.git diff --git a/palacios/src/palacios/vmx_handler.c b/palacios/src/palacios/vmx_handler.c index 1da8a58..e5da762 100644 --- a/palacios/src/palacios/vmx_handler.c +++ b/palacios/src/palacios/vmx_handler.c @@ -32,17 +32,17 @@ #include #include +#ifndef CONFIG_DEBUG_VMX +#undef PrintDebug +#define PrintDebug(fmt, args...) +#endif + #ifdef CONFIG_TELEMETRY #include #endif - - - /* At this point the GPRs are already copied into the guest_info state */ int v3_handle_vmx_exit(struct guest_info * info, struct vmx_exit_info * exit_info) { - struct vmx_data * vmx_info = (struct vmx_data *)(info->vmm_data); - /* PrintError("Handling VMEXIT: %s (%u), %lu (0x%lx)\n", v3_vmx_exit_code_to_str(exit_info->exit_reason), @@ -51,8 +51,9 @@ int v3_handle_vmx_exit(struct guest_info * info, struct vmx_exit_info * exit_inf v3_print_vmcs(); */ + #ifdef CONFIG_TELEMETRY - if (info->enable_telemetry) { + if (info->vm_info->enable_telemetry) { v3_telemetry_start_exit(info); } #endif @@ -94,6 +95,18 @@ int v3_handle_vmx_exit(struct guest_info * info, struct vmx_exit_info * exit_inf } break; + + case VMEXIT_RDTSC: +#ifdef CONFIG_DEBUG_TIME + PrintDebug("RDTSC\n"); +#endif + if (v3_handle_rdtsc(info) == -1) { + PrintError("Error Handling RDTSC instruction\n"); + return -1; + } + + break; + case VMEXIT_CPUID: if (v3_handle_cpuid(info) == -1) { PrintError("Error Handling CPUID instruction\n"); @@ -204,15 +217,8 @@ int v3_handle_vmx_exit(struct guest_info * info, struct vmx_exit_info * exit_inf // Interrupts are handled outside switch break; case VMEXIT_INTR_WINDOW: - - vmcs_read(VMCS_PROC_CTRLS, &(vmx_info->pri_proc_ctrls.value)); - vmx_info->pri_proc_ctrls.int_wndw_exit = 0; - vmcs_write(VMCS_PROC_CTRLS, vmx_info->pri_proc_ctrls.value); - -#ifdef CONFIG_DEBUG_INTERRUPTS - PrintDebug("Interrupts available again! (RIP=%llx)\n", info->rip); -#endif - + // This is handled in the atomic part of the vmx code, + // not in the generic (interruptable) vmx handler break; default: PrintError("Unhandled VMEXIT: %s (%u), %lu (0x%lx)\n", @@ -222,12 +228,14 @@ int v3_handle_vmx_exit(struct guest_info * info, struct vmx_exit_info * exit_inf return -1; } + #ifdef CONFIG_TELEMETRY - if (info->enable_telemetry) { + if (info->vm_info->enable_telemetry) { v3_telemetry_end_exit(info, exit_info->exit_reason); } #endif + return 0; }