X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fsvm.c;h=86424e9ee82c648dbe28a4ba7debabb1fb00f7e9;hb=30379ff13457e9687c5ab5acb67e92a5757fb5c6;hp=f5489c3f9f0b42716b8bad6b9ed086c9b2d97268;hpb=24178516ccd9f46718b687d4c630415eb63ff595;p=palacios.git diff --git a/palacios/src/palacios/svm.c b/palacios/src/palacios/svm.c index f5489c3..86424e9 100644 --- a/palacios/src/palacios/svm.c +++ b/palacios/src/palacios/svm.c @@ -39,6 +39,8 @@ #include +#include + extern void v3_stgi(); extern void v3_clgi(); @@ -352,7 +354,6 @@ static int start_svm_guest(struct guest_info *info) { ullong_t tmp_tsc; uint_t vm_cr_low = 0, vm_cr_high = 0; - v3_enable_ints(); v3_clgi(); @@ -384,10 +385,13 @@ static int start_svm_guest(struct guest_info *info) { v3_stgi(); - if (num_exits % 25 == 0) { + if ((num_exits % 5000) == 0) { PrintDebug("SVM Exit number %d\n", num_exits); + if (info->enable_profiler) + v3_print_profile(info); } + if (v3_handle_svm_exit(info) != 0) { vmcb_ctrl_t * guest_ctrl = GET_VMCB_CTRL_AREA((vmcb_t*)(info->vmm_data)); @@ -416,10 +420,6 @@ static int start_svm_guest(struct guest_info *info) { } v3_print_GPRs(info); - - - - PrintDebug("SVM Exit Code: %p\n", (void *)(addr_t)guest_ctrl->exit_code); PrintDebug("exit_info1 low = 0x%.8x\n", *(uint_t*)&(guest_ctrl->exit_info1)); @@ -442,6 +442,7 @@ static int start_svm_guest(struct guest_info *info) { break; } + } return 0; } @@ -461,7 +462,7 @@ int v3_is_svm_capable() { v3_cpuid(CPUID_FEATURE_IDS, &eax, &ebx, &ecx, &edx); - PrintDebug("CPUID_FEATURE_IDS_ecx=0x%p\n", (void *)ecx); + PrintDebug("CPUID_FEATURE_IDS_ecx=%p\n", (void *)ecx); if ((ecx & CPUID_FEATURE_IDS_ecx_svm_avail) == 0) { PrintDebug("SVM Not Available\n"); @@ -476,7 +477,7 @@ int v3_is_svm_capable() { v3_cpuid(CPUID_SVM_REV_AND_FEATURE_IDS, &eax, &ebx, &ecx, &edx); - PrintDebug("CPUID_FEATURE_IDS_edx=0x%p\n", (void *)edx); + PrintDebug("CPUID_FEATURE_IDS_edx=%p\n", (void *)edx); if ((edx & CPUID_SVM_REV_AND_FEATURE_IDS_edx_svml) == 0) { PrintDebug("SVM BIOS Disabled, not unlockable\n"); @@ -489,8 +490,11 @@ int v3_is_svm_capable() { PrintDebug("SVM is available and enabled.\n"); v3_cpuid(CPUID_SVM_REV_AND_FEATURE_IDS, &eax, &ebx, &ecx, &edx); - - PrintDebug("CPUID_FEATURE_IDS_edx=0x%p\n", (void *)edx); + PrintDebug("CPUID_FEATURE_IDS_eax=%p\n", (void *)eax); + PrintDebug("CPUID_FEATURE_IDS_ebx=%p\n", (void *)ebx); + PrintDebug("CPUID_FEATURE_IDS_ecx=%p\n", (void *)ecx); + PrintDebug("CPUID_FEATURE_IDS_edx=%p\n", (void *)edx); + if ((edx & CPUID_SVM_REV_AND_FEATURE_IDS_edx_np) == 0) { PrintDebug("SVM Nested Paging not supported\n");