X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fsvm_handler.c;h=d8fde213c65f88dd10c18438f73a0b8b0b67cb07;hb=16745fa0dd0900263d4d92315cd17e0ed9ccae91;hp=9088af32934baee991fa190da53bee0d8bca2652;hpb=0c31bb41ac41d04a891a6eeff5bae398fa89b419;p=palacios.git diff --git a/palacios/src/palacios/svm_handler.c b/palacios/src/palacios/svm_handler.c index 9088af3..d8fde21 100644 --- a/palacios/src/palacios/svm_handler.c +++ b/palacios/src/palacios/svm_handler.c @@ -34,6 +34,10 @@ #include #include +#ifndef CONFIG_DEBUG_SVM +#undef PrintDebug +#define PrintDebug(fmt, args...) +#endif #ifdef CONFIG_TELEMETRY #include @@ -50,11 +54,6 @@ int v3_handle_svm_exit(struct guest_info * info, addr_t exit_code, addr_t exit_i #endif -#if 0 - if (info->cpu_id==1) { - V3_Print("Core 1 SVM Exit: %s rip=0x%p\n", vmexit_code_to_str(exit_code), (void *) get_addr_linear(info, info->rip, &(info->segments.cs))); - } -#endif //PrintDebug("SVM Returned: Exit Code: %x\n",exit_code); switch (exit_code) { @@ -170,12 +169,6 @@ int v3_handle_svm_exit(struct guest_info * info, addr_t exit_code, addr_t exit_i PrintDebug("PageFault at %p (error=%d)\n", (void *)fault_addr, *(uint_t *)error_code); #endif -#if 0 - if (info->cpu_id==1) { - V3_Print("SVM Core 1: PageFault at %p (error=%d)\n", - (void *)fault_addr, *(uint_t *)error_code); - } -#endif if (info->shdw_pg_mode == SHADOW_PAGING) { if (v3_handle_shadow_pagefault(info, fault_addr, *error_code) == -1) { return -1; @@ -253,9 +246,32 @@ int v3_handle_svm_exit(struct guest_info * info, addr_t exit_code, addr_t exit_i return -1; } break; - + case VMEXIT_RDTSC: +#ifdef CONFIG_DEBUG_TIME + PrintDebug("RDTSC/RDTSCP\n"); +#endif + if (v3_handle_rdtsc(info) == -1) { + PrintError("Error Handling RDTSC instruction\n"); + return -1; + } + break; + case VMEXIT_RDTSCP: +#ifdef CONFIG_DEBUG_TIME + PrintDebug("RDTSCP\n"); +#endif + if (v3_handle_rdtscp(info) == -1) { + PrintError("Error Handling RDTSCP instruction\n"); + return -1; + } + break; + case VMEXIT_SHUTDOWN: + PrintDebug("Guest-initiated shutdown\n"); + + info->vm_info->run_state = VM_STOPPED; + // Force exit on other cores + break; /* Exits Following this line are NOT HANDLED */