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.


changed memory map to be layered on top of a single contiguous allocation
[palacios.git] / palacios / src / palacios / vmm_shadow_paging_64.h
index f0dcd31..5bcf9c9 100644 (file)
@@ -131,11 +131,8 @@ static inline int handle_shadow_pagefault_64(struct guest_info * info, addr_t fa
        shadow_pml4e->present = 1;
        shadow_pml4e->user_page = guest_pml4e->user_page;
        shadow_pml4e->writable = guest_pml4e->writable;
-    
-       // VMM Specific options
-       shadow_pml4e->write_through = 0;
-       shadow_pml4e->cache_disable = 0;
-       //
+       shadow_pml4e->cache_disable = guest_pml4e->cache_disable;
+       shadow_pml4e->write_through = guest_pml4e->write_through;
     
        guest_pml4e->accessed = 1;
     
@@ -225,11 +222,9 @@ static int handle_pdpe_shadow_pagefault_64(struct guest_info * info, addr_t faul
        shadow_pdpe->present = 1;
        shadow_pdpe->user_page = guest_pdpe->user_page;
        shadow_pdpe->writable = guest_pdpe->writable;
-    
-       // VMM Specific options
-       shadow_pdpe->write_through = 0;
-       shadow_pdpe->cache_disable = 0;
-       //
+       shadow_pdpe->write_through = guest_pdpe->write_through;
+       shadow_pdpe->cache_disable = guest_pdpe->cache_disable;
+
     
        guest_pdpe->accessed = 1;
     
@@ -339,9 +334,9 @@ static int handle_pde_shadow_pagefault_64(struct guest_info * info, addr_t fault
        }
     
        // VMM Specific options
-       shadow_pde->write_through = 0;
-       shadow_pde->cache_disable = 0;
-       shadow_pde->global_page = 0;
+       shadow_pde->write_through = guest_pde->write_through;
+       shadow_pde->cache_disable = guest_pde->cache_disable;
+       shadow_pde->global_page = guest_pde->global_page;
        //
     
        guest_pde->accessed = 1;
@@ -390,8 +385,7 @@ static int handle_pte_shadow_pagefault_64(struct guest_info * info, addr_t fault
 
 
 
-    if ((shdw_reg == NULL) || 
-       (shdw_reg->host_type == SHDW_REGION_INVALID)) {
+    if (shdw_reg == NULL) {
        // Inject a machine check in the guest
        PrintDebug("Invalid Guest Address in page table (0x%p)\n", (void *)guest_pa);
        v3_raise_exception(info, MC_EXCEPTION);
@@ -435,9 +429,9 @@ static int handle_pte_shadow_pagefault_64(struct guest_info * info, addr_t fault
            shadow_pte->user_page = guest_pte->user_page;
       
            //set according to VMM policy
-           shadow_pte->write_through = 0;
-           shadow_pte->cache_disable = 0;
-           shadow_pte->global_page = 0;
+           shadow_pte->write_through = guest_pte->write_through;
+           shadow_pte->cache_disable = guest_pte->cache_disable;
+           shadow_pte->global_page = guest_pte->global_page;
            //
       
            guest_pte->accessed = 1;
@@ -523,12 +517,11 @@ static int handle_2MB_shadow_pagefault_64(struct guest_info * info,
     struct v3_shadow_region * shdw_reg = v3_get_shadow_region(info, guest_fault_pa);
 
  
-    if ((shdw_reg == NULL) || 
-       (shdw_reg->host_type == SHDW_REGION_INVALID)) {
+    if (shdw_reg == NULL) {
        // Inject a machine check in the guest
        PrintDebug("Invalid Guest Address in page table (0x%p)\n", (void *)guest_fault_pa);
        v3_raise_exception(info, MC_EXCEPTION);
-       return -1;
+       return 0;
     }
 
     if (shadow_pte_access == PT_ACCESS_OK) {
@@ -574,9 +567,9 @@ static int handle_2MB_shadow_pagefault_64(struct guest_info * info,
            }
 
            //set according to VMM policy
-           shadow_pte->write_through = 0;
-           shadow_pte->cache_disable = 0;
-           shadow_pte->global_page = 0;
+           shadow_pte->write_through = large_guest_pde->write_through;
+           shadow_pte->cache_disable = large_guest_pde->cache_disable;
+           shadow_pte->global_page = large_guest_pde->global_page;
            //
       
        } else {