v3_svm_config_tsc_virtualization(struct guest_info * info) {
vmcb_ctrl_t * ctrl_area = GET_VMCB_CTRL_AREA((vmcb_t*)(info->vmm_data));
- if (!(info->time_state.flags & VM_TIME_TRAP_RDTSC)) {
+
+ if (info->time_state.flags & VM_TIME_TRAP_RDTSC) {
+ ctrl_area->instrs.RDTSC = 1;
+ ctrl_area->svm_instrs.RDTSCP = 1;
+ } else {
+ ctrl_area->instrs.RDTSC = 0;
+ ctrl_area->svm_instrs.RDTSCP = 0;
+
if (info->time_state.flags & VM_TIME_TSC_PASSTHROUGH) {
ctrl_area->TSC_OFFSET = 0;
} else {
#ifdef V3_CONFIG_DEBUG_TIME
PrintDebug("RDTSC/RDTSCP\n");
#endif
- if (v3_dispatch_exit_hook(info, V3_EXIT_RDTSC, NULL) == -1) {
+ if (v3_handle_rdtsc(info) == -1) {
PrintError("Error Handling RDTSC instruction\n");
return -1;
}
#ifdef V3_CONFIG_DEBUG_TIME
PrintDebug("RDTSCP\n");
#endif
- if (v3_dispatch_exit_hook(info, V3_EXIT_RDTSCP, NULL) == -1) {
+ if (v3_handle_rdtscp(info) == -1) {
PrintError("Error handling RDTSCP instruction\n");
return -1;
}