Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


HVM capability enhancement: asynchronous upcalls to ROS userspace
[palacios.git] / palacios / src / palacios / svm.c
index 6ecdb12..28c8a70 100644 (file)
@@ -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);