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.


Added support for SMI interrupt
[palacios.git] / palacios / src / palacios / vm_guest_mem.c
index eb342b4..105322e 100644 (file)
@@ -115,15 +115,14 @@ int guest_pa_to_host_va(struct guest_info * guest_info, addr_t guest_pa, addr_t
 
 
 int guest_va_to_guest_pa(struct guest_info * guest_info, addr_t guest_va, addr_t * guest_pa) {
-  if (guest_info->shdw_pg_mode == SHADOW_PAGING) {
-    if (guest_info->mem_mode == PHYSICAL_MEM) {
-      // guest virtual address is the same as the physical
-      *guest_pa = guest_va;
-      return 0;
-    }
-    
-    
+  if (guest_info->mem_mode == PHYSICAL_MEM) {
+    // guest virtual address is the same as the physical
+    *guest_pa = guest_va;
+    return 0;
+  }
+
 
+  if (guest_info->shdw_pg_mode == SHADOW_PAGING) {
     // Guest Is in Paged mode
     switch (guest_info->cpu_mode) {
     case PROTECTED:
@@ -184,7 +183,7 @@ int guest_va_to_guest_pa(struct guest_info * guest_info, addr_t guest_va, addr_t
   } else if (guest_info->shdw_pg_mode == NESTED_PAGING) {
 
     // Fill in
-
+    return -1;
   } else {
     return -1;
   }
@@ -326,7 +325,8 @@ int read_guest_va_memory(struct guest_info * guest_info, addr_t guest_va, int co
     /* JRL FIXME:
      * This should be somewhere else....
      */
-    addr_t tmp_addr;
+    /*  
+  addr_t tmp_addr;
       
     addr_t shadow_pde = CR3_TO_PDE32(guest_info->shdw_pg_state.shadow_cr3);
     
@@ -346,15 +346,16 @@ int read_guest_va_memory(struct guest_info * guest_info, addr_t guest_va, int co
        return bytes_read;
       }
     }
+*/
     /* JRL: END GRUESOME HACK */
 
 
-    /*
-      if (guest_va_to_host_va(guest_info, cursor, &host_addr) != 0) {
+    
+    if (guest_va_to_host_va(guest_info, cursor, &host_addr) != 0) {
       PrintDebug("Invalid GVA(%x)->HVA lookup\n", cursor);
       return bytes_read;
-      }
-    */
+    }
+    
     
 
     memcpy(dest + bytes_read, (void*)host_addr, bytes_to_copy);