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 page table deletion error
Jack Lange [Tue, 24 Jun 2008 04:06:44 +0000 (04:06 +0000)]
palacios/src/palacios/vmm_ctrl_regs.c
palacios/src/palacios/vmm_paging.c

index 7d59b82..0d29092 100644 (file)
@@ -450,9 +450,12 @@ int handle_cr3_write(struct guest_info * info) {
        struct cr3_32 * shadow_cr3 = (struct cr3_32 *)&(info->shdw_pg_state.shadow_cr3);
        struct cr3_32 * guest_cr3 = (struct cr3_32 *)&(info->shdw_pg_state.guest_cr3);
 
+       PrintDebug("fooo1\n");
+
        /* Delete the current Page Tables */
-       delete_page_tables_pde32((pde32_t *)CR3_TO_PDE32(shadow_cr3));
+       delete_page_tables_pde32((pde32_t *)CR3_TO_PDE32(*(uint_t*)shadow_cr3));
 
+       PrintDebug("fooo2\n");
        *guest_cr3 = *new_cr3;
 
        // Something like this
index a20e0bf..7c8d8af 100644 (file)
@@ -8,7 +8,7 @@
 extern struct vmm_os_hooks * os_hooks;
 
 void delete_page_tables_pde32(pde32_t * pde) {
-  int i, j;
+  int i;//, j;
 
   if (pde == NULL) { 
     return;
@@ -17,17 +17,20 @@ void delete_page_tables_pde32(pde32_t * pde) {
   for (i = 0; (i < MAX_PDE32_ENTRIES); i++) {
     if (pde[i].present) {
       pte32_t * pte = (pte32_t *)(pde[i].pt_base_addr << PAGE_POWER);
-      
-      for (j = 0; (j < MAX_PTE32_ENTRIES); j++) {
+
+      /*
+       for (j = 0; (j < MAX_PTE32_ENTRIES); j++) {
        if ((pte[j].present)) {
-         os_hooks->free_page((void *)(pte[j].page_base_addr << PAGE_POWER));
+       os_hooks->free_page((void *)(pte[j].page_base_addr << PAGE_POWER));
        }
-      }
-      
+       }
+      */
+      //PrintDebug("Deleting PTE %d (%x)\n", i, pte);
       os_hooks->free_page(pte);
     }
   }
 
+  //  PrintDebug("Deleting PDE (%x)\n", pde);
   os_hooks->free_page(pde);
 }