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.


Fixed nested paging to work again, minor change to configuration syntax of shadow...
Patrick Bridges [Thu, 29 Jul 2010 21:30:05 +0000 (15:30 -0600)]
Updated default.xml appropriately.

palacios/src/palacios/vmm_config.c
palacios/src/palacios/vmm_direct_paging_32.h
palacios/src/palacios/vmm_direct_paging_32pae.h
palacios/src/palacios/vmm_direct_paging_64.h
palacios/src/palacios/vmm_shadow_paging.c
utils/guest_creator/default.xml

index 11814a6..7aee4cc 100644 (file)
@@ -247,7 +247,7 @@ static int determine_paging_mode(struct guest_info *info, v3_cfg_tree_t * core_c
 
     v3_cfg_tree_t *vm_tree = info->vm_info->cfg_data->cfg;
     v3_cfg_tree_t *pg_tree = v3_cfg_subtree(vm_tree, "paging");
-    char *pg_type = v3_cfg_val(pg_tree, "type");
+    char *pg_type = v3_cfg_val(vm_tree, "paging");
     char *pg_mode = v3_cfg_val(pg_tree, "mode");
     
     PrintDebug("Paging mode specified as %s(%s)\n", pg_type, pg_mode);
index 9dee550..b211ad9 100644 (file)
@@ -47,11 +47,6 @@ static inline int handle_passthrough_pagefault_32(struct guest_info * info,
        return -1;
     }
     
-    if (v3_gpa_to_hpa(info, fault_addr, &host_addr) == -1) {
-       PrintError("Could not translate fault address (%p)\n", (void *)fault_addr);
-       return -1;
-    }
-
     // Lookup the correct PDE address based on the PAGING MODE
     if (info->shdw_pg_mode == SHADOW_PAGING) {
        pde = CR3_TO_PDE32_VA(info->ctrl_regs.cr3);
@@ -89,6 +84,11 @@ static inline int handle_passthrough_pagefault_32(struct guest_info * info,
            } else {
                pte[pte_index].writable = 0;
            }
+
+           if (v3_gpa_to_hpa(info, fault_addr, &host_addr) == -1) {
+               PrintError("Could not translate fault address (%p)\n", (void *)fault_addr);
+               return -1;
+           }
            
            pte[pte_index].page_base_addr = PAGE_BASE_ADDR(host_addr);
        } else {
index 61ef6d9..a2bb71d 100644 (file)
@@ -48,11 +48,6 @@ static inline int handle_passthrough_pagefault_32pae(struct guest_info * info,
        return -1;
     }
 
-    if (v3_gpa_to_hpa(info, fault_addr, &host_addr) == -1) {
-       PrintError("Could not translate fault address (%p)\n", (void *)fault_addr);
-       return -1;
-    }
-
     // Lookup the correct PDPE address based on the PAGING MODE
     if (info->shdw_pg_mode == SHADOW_PAGING) {
        pdpe = CR3_TO_PDPE32PAE_VA(info->ctrl_regs.cr3);
@@ -101,6 +96,11 @@ static inline int handle_passthrough_pagefault_32pae(struct guest_info * info,
                pte[pte_index].writable = 0;
            }
 
+           if (v3_gpa_to_hpa(info, fault_addr, &host_addr) == -1) {
+               PrintError("Could not translate fault address (%p)\n", (void *)fault_addr);
+               return -1;
+           }
+
            pte[pte_index].page_base_addr = PAGE_BASE_ADDR(host_addr);
        } else {
            return region->unhandled(info, fault_addr, fault_addr, region, error_code);
index 1eb947d..a0408d9 100644 (file)
@@ -54,12 +54,6 @@ static inline int handle_passthrough_pagefault_64(struct guest_info * info,
        return -1;
     }
 
-    if (v3_gpa_to_hpa(info, fault_addr, &host_addr) == -1) {
-       PrintError("Error Could not translate fault addr (%p)\n", (void *)fault_addr);
-       return -1;
-    }
-
-
     // Lookup the correct PML address based on the PAGING MODE
     if (info->shdw_pg_mode == SHADOW_PAGING) {
        pml = CR3_TO_PML4E64_VA(info->ctrl_regs.cr3);
@@ -125,6 +119,11 @@ static inline int handle_passthrough_pagefault_64(struct guest_info * info,
                pte[pte_index].writable = 0;
            }
 
+           if (v3_gpa_to_hpa(info, fault_addr, &host_addr) == -1) {
+               PrintError("Error Could not translate fault addr (%p)\n", (void *)fault_addr);
+               return -1;
+           }
+
            pte[pte_index].page_base_addr = PAGE_BASE_ADDR(host_addr);
        } else {
            return region->unhandled(info, fault_addr, fault_addr, region, error_code);
index da219c2..6d6cfec 100644 (file)
@@ -141,22 +141,22 @@ int v3_init_shdw_pg_state(struct guest_info * core) {
 int v3_init_shdw_impl(struct v3_vm_info * vm) {
     struct v3_shdw_impl_state * impl_state = &(vm->shdw_impl);
     v3_cfg_tree_t * pg_cfg = v3_cfg_subtree(vm->cfg_data->cfg, "paging");
-    char * type_name = v3_cfg_val(pg_cfg, "type");
-    char * impl_name = v3_cfg_val(pg_cfg, "mode");
+    char * pg_type = v3_cfg_val(vm->cfg_data->cfg, "paging");
+    char * pg_mode = v3_cfg_val(pg_cfg, "mode");
     struct v3_shdw_pg_impl * impl = NULL;
    
     PrintDebug("Checking if shadow paging requested.\n");
-    if (type_name && (strcasecmp(type_name, "nested") == 0)) {
+    if (pg_type && (strcasecmp(pg_type, "nested") == 0)) {
        PrintDebug("Nested paging specified - not initializing shadow paging.\n");
        return 0;
     }
        
     V3_Print("Initialization of Shadow Paging implementation\n");
 
-    impl = (struct v3_shdw_pg_impl *)v3_htable_search(master_shdw_pg_table, (addr_t)impl_name);
+    impl = (struct v3_shdw_pg_impl *)v3_htable_search(master_shdw_pg_table, (addr_t)pg_mode);
 
     if (impl == NULL) {
-       PrintError("Could not find shadow paging impl (%s)\n", impl_name);
+       PrintError("Could not find shadow paging impl (%s)\n", pg_mode);
        return -1;
     }
    
index a11f33e..cc0bc98 100644 (file)
@@ -7,8 +7,8 @@
 
        <!-- Basic VMM system flags -->
        <telemetry>enable</telemetry>
-       <paging type="shadow" mode="VTLB"/>
-       <!-- <paging type="nested" mode="4KB"/> -->
+       <paging mode="VTLB">shadow</paging>
+       <!-- <paging mode="4KB">nested</paging> -->
        <schedule_hz>100</schedule_hz>
 
        <cores count="1"><core /></cores>