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.


significant refactoring of RTM emulation code
[palacios.git] / palacios / src / palacios / mmu / vmm_shdw_pg_tlb_64.h
index 76d22f9..0d809af 100644 (file)
@@ -17,6 +17,9 @@
  * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
  */
 
+#ifdef V3_CONFIG_TM_FUNC
+#include <extensions/trans_mem.h>
+#endif
 
 static inline int activate_shadow_pt_64(struct guest_info * info) {
     struct cr3_64 * shadow_cr3 = (struct cr3_64 *)&(info->ctrl_regs.cr3);
@@ -465,11 +468,17 @@ static int handle_pte_shadow_pagefault_64(struct guest_info * info, addr_t fault
        return 0;
     }
 
-
     if (shadow_pte_access == PT_ACCESS_NOT_PRESENT) {
        // Page Table Entry Not Present
        PrintDebug(info->vm_info, info, "guest_pa =%p\n", (void *)guest_pa);
 
+#ifdef V3_CONFIG_TM_FUNC
+        addr_t page_to_use;
+        if (v3_tm_handle_pf_64(info, error_code, fault_addr, &page_to_use) == -1) {
+            return -1;
+        }
+#endif
+
        if ((shdw_reg->flags.alloced == 1) ||
            (shdw_reg->flags.read == 1)) {
            addr_t shadow_pa = 0;
@@ -479,6 +488,10 @@ static int handle_pte_shadow_pagefault_64(struct guest_info * info, addr_t fault
                return -1;
            }
 
+#ifdef V3_CONFIG_TM_FUNC
+            v3_tm_handle_usr_tlb_miss(info, error_code, page_to_use, &shadow_pa);
+#endif
+
            shadow_pte->page_base_addr = PAGE_BASE_ADDR(shadow_pa);
       
            shadow_pte->present = guest_pte->present;
@@ -507,6 +520,9 @@ static int handle_pte_shadow_pagefault_64(struct guest_info * info, addr_t fault
                shadow_pte->writable = 0;
            }
 
+#ifdef V3_CONFIG_TM_FUNC
+        v3_tm_handle_read_fault(info, error_code, shadow_pte);
+#endif
        } else {
            // Pass to unhandled call back
            if (shdw_reg->unhandled(info, fault_addr, guest_pa, shdw_reg, error_code) == -1) {