X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmx_handler.c;h=357f0d21ac29f7a72c80bfa91f962be08b501de1;hb=07a12ade201ee7c2fe2358084ca079d2facac500;hp=3fa4f98bf506902376d2af60dcf412941e304384;hpb=5bf6d0c260240e314876a2fca8e3fd56bd6a1029;p=palacios.git diff --git a/palacios/src/palacios/vmx_handler.c b/palacios/src/palacios/vmx_handler.c index 3fa4f98..357f0d2 100644 --- a/palacios/src/palacios/vmx_handler.c +++ b/palacios/src/palacios/vmx_handler.c @@ -32,13 +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); @@ -51,8 +55,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 +99,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"); @@ -133,24 +150,24 @@ int v3_handle_vmx_exit(struct guest_info * info, struct vmx_exit_info * exit_inf if (io_qual->dir == 0) { if (io_qual->string) { - if (v3_handle_vmx_io_outs(info) == -1) { + if (v3_handle_vmx_io_outs(info, exit_info) == -1) { PrintError("Error in outs IO handler\n"); return -1; } } else { - if (v3_handle_vmx_io_out(info) == -1) { + if (v3_handle_vmx_io_out(info, exit_info) == -1) { PrintError("Error in out IO handler\n"); return -1; } } } else { if (io_qual->string) { - if(v3_handle_vmx_io_ins(info) == -1) { + if(v3_handle_vmx_io_ins(info, exit_info) == -1) { PrintError("Error in ins IO handler\n"); return -1; } } else { - if (v3_handle_vmx_io_in(info) == -1) { + if (v3_handle_vmx_io_in(info, exit_info) == -1) { PrintError("Error in in IO handler\n"); return -1; } @@ -222,12 +239,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; }