X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fsvm.c;h=28c8a701f0b987d5c0bec6410b013b0d381624e7;hb=4e43946f01f687361197dc9571b7df02ae20de30;hp=6ecdb12560d505137ca192444cfd3fc8ca69674a;hpb=4931bc084ced4bcb172c7bcb197ab55b1c9bdf80;p=palacios.git diff --git a/palacios/src/palacios/svm.c b/palacios/src/palacios/svm.c index 6ecdb12..28c8a70 100644 --- a/palacios/src/palacios/svm.c +++ b/palacios/src/palacios/svm.c @@ -799,6 +799,10 @@ int v3_svm_enter(struct guest_info * info) { v3_mem_track_entry(info); #endif +#ifdef V3_CONFIG_HVM + v3_handle_hvm_entry(info); +#endif + // Update timer devices after being in the VM before doing // IRQ updates, so that any interrupts they raise get seen // immediately. @@ -1005,6 +1009,10 @@ int v3_svm_enter(struct guest_info * info) { v3_handle_timeouts(info, guest_cycles); } +#ifdef V3_CONFIG_HVM + v3_handle_hvm_exit(info); +#endif + #ifdef V3_CONFIG_MEM_TRACK v3_mem_track_exit(info); #endif @@ -1145,9 +1153,15 @@ int v3_start_svm_guest(struct guest_info * info) { linear_addr = get_addr_linear(info, info->rip, &(info->segments.cs)); if (info->mem_mode == PHYSICAL_MEM) { - v3_gpa_to_hva(info, linear_addr, &host_addr); + if (v3_gpa_to_hva(info, linear_addr, &host_addr)) { + PrintError(info->vm_info, info, "Cannot translate address\n"); + break; + } } else if (info->mem_mode == VIRTUAL_MEM) { - v3_gva_to_hva(info, linear_addr, &host_addr); + if (v3_gva_to_hva(info, linear_addr, &host_addr)) { + PrintError(info->vm_info, info, "Cannot translate address\n"); + break; + } } V3_Print(info->vm_info, info, "SVM core %u: Host Address of rip = 0x%p\n", info->vcpu_id, (void *)host_addr); @@ -1239,7 +1253,7 @@ int v3_is_svm_capable() { PrintDebug(VM_NONE, VCORE_NONE, "SVM_VM_CR_MSR = 0x%x 0x%x\n", vm_cr_high, vm_cr_low); - if ((vm_cr_low & SVM_VM_CR_MSR_svmdis) == 1) { + if (vm_cr_low & SVM_VM_CR_MSR_svmdis) { V3_Print(VM_NONE, VCORE_NONE, "SVM is available but is disabled.\n"); v3_cpuid(CPUID_SVM_REV_AND_FEATURE_IDS, &eax, &ebx, &ecx, &edx);