X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_paging.c;h=7643dd9e6d5654a04a4c47a50787f5db773a7a72;hb=074523a44f8e4e91f0945633b36cd39cc1d959f9;hp=cdb14f71e9f6a4ab98aa19c2709fd7b50c1c9c85;hpb=5b6278751429f59297ce74e614d50632daea3748;p=palacios.git diff --git a/palacios/src/palacios/vmm_paging.c b/palacios/src/palacios/vmm_paging.c index cdb14f7..7643dd9 100644 --- a/palacios/src/palacios/vmm_paging.c +++ b/palacios/src/palacios/vmm_paging.c @@ -25,12 +25,14 @@ - - +#define USE_VMM_PAGING_DEBUG +// All of the debug functions defined in vmm_paging.h are implemented in this file +#include "vmm_paging_debug.h" +#undef USE_VMM_PAGING_DEBUG -void delete_page_tables_pde32(pde32_t * pde) { - int i;//, j; +void delete_page_tables_32(pde32_t * pde) { + int i; if (pde == NULL) { return; @@ -42,13 +44,6 @@ void delete_page_tables_pde32(pde32_t * pde) { PrintDebug("PTE base addr %x \n", pde[i].pt_base_addr); pte32_t * pte = (pte32_t *)((addr_t)(uint_t)(pde[i].pt_base_addr << PAGE_POWER)); - /* - for (j = 0; (j < MAX_PTE32_ENTRIES); j++) { - if ((pte[j].present)) { - os_hooks->free_page((void *)(pte[j].page_base_addr << PAGE_POWER)); - } - } - */ PrintDebug("Deleting PTE %d (%p)\n", i, pte); V3_FreePage(pte); } @@ -58,89 +53,285 @@ void delete_page_tables_pde32(pde32_t * pde) { V3_FreePage(V3_PAddr(pde)); } +void delete_page_tables_32PAE(pdpe32pae_t * pdpe) { + PrintError("Unimplemented function\n"); +} +void delete_page_tables_64(pml4e64_t * pml4) { + PrintError("Unimplemented function\n"); +} +int translate_guest_pt_32(struct guest_info * info, addr_t guest_cr3, addr_t vaddr, addr_t * paddr) { + addr_t guest_pde_pa = CR3_TO_PDE32_PA((void *)guest_cr3); + pde32_t * guest_pde = 0; + addr_t guest_pte_pa = 0; -int pt32_lookup(pde32_t * pd, addr_t vaddr, addr_t * paddr) { - addr_t pde_entry; - pde32_entry_type_t pde_entry_type; - - if (pd == 0) { + if (guest_pa_to_host_va(info, guest_pde_pa, (addr_t*)&guest_pde) == -1) { + PrintError("Could not get virtual address of Guest PDE32 (PA=%p)\n", + (void *)guest_pde_pa); return -1; } + + switch (pde32_lookup(guest_pde, vaddr, &guest_pte_pa)) { + case PT_ENTRY_NOT_PRESENT: + *paddr = 0; + return -1; + case PT_ENTRY_LARGE_PAGE: + *paddr = guest_pte_pa; + return 0; + case PT_ENTRY_PAGE: + { + pte32_t * guest_pte; + if (guest_pa_to_host_va(info, guest_pte_pa, (addr_t*)&guest_pte) == -1) { + PrintError("Could not get virtual address of Guest PTE32 (PA=%p)\n", + (void *)guest_pte_pa); + return -1; + } + + if (pte32_lookup(guest_pte, vaddr, paddr) == -1) { + return -1; + } + } + } + + return 0; +} - pde_entry_type = pde32_lookup(pd, vaddr, &pde_entry); - if (pde_entry_type == PDE32_ENTRY_PTE32) { - return pte32_lookup((pte32_t *)pde_entry, vaddr, paddr); - } else if (pde_entry_type == PDE32_ENTRY_LARGE_PAGE) { - *paddr = pde_entry; +int translate_host_pt_32(addr_t host_cr3, addr_t vaddr, addr_t * paddr) { + pde32_t * host_pde = (pde32_t *)CR3_TO_PDE32_VA((void *)host_cr3); + pte32_t * host_pte = 0; + + switch (pde32_lookup(host_pde, vaddr, (addr_t *)&host_pte)) { + case PT_ENTRY_NOT_PRESENT: + *paddr = 0; + return -1; + case PT_ENTRY_LARGE_PAGE: + *paddr = (addr_t)host_pte; return 0; + case PT_ENTRY_PAGE: + if (pte32_lookup(host_pte, vaddr, paddr) == -1) { + return -1; + } } + return 0; +} + + +int translate_host_pt_32pae(addr_t host_cr3, addr_t vaddr, addr_t * paddr) { + + + return -1; +} + + +int translate_host_pt_64(addr_t host_cr3, addr_t vaddr, addr_t * paddr) { + + return -1; } -/* We can't do a full lookup because we don't know what context the page tables are in... - * The entry addresses could be pointing to either guest physical memory or host physical memory - * Instead we just return the entry address, and a flag to show if it points to a pte or a large page... + + +/* + * PAGE TABLE LOOKUP FUNCTIONS + * + * + * The value of entry is a return type: + * Page not present: *entry = 0 + * Large Page: *entry = translated physical address (byte granularity) + * PTE entry: *entry is the address of the PTE Page */ -pde32_entry_type_t pde32_lookup(pde32_t * pd, addr_t addr, addr_t * entry) { + +/** + * + * 32 bit Page Table lookup functions + * + **/ + +pt_entry_type_t pde32_lookup(pde32_t * pd, addr_t addr, addr_t * entry) { pde32_t * pde_entry = &(pd[PDE32_INDEX(addr)]); if (!pde_entry->present) { *entry = 0; - return PDE32_ENTRY_NOT_PRESENT; - } else { + return PT_ENTRY_NOT_PRESENT; + } else if (pde_entry->large_page) { + pde32_4MB_t * large_pde = (pde32_4MB_t *)pde_entry; - if (pde_entry->large_page) { - pde32_4MB_t * large_pde = (pde32_4MB_t *)pde_entry; + *entry = BASE_TO_PAGE_ADDR_4MB(large_pde->page_base_addr); + *entry += PAGE_OFFSET_4MB(addr); - *entry = PDE32_4MB_T_ADDR(*large_pde); - *entry += PD32_4MB_PAGE_OFFSET(addr); - return PDE32_ENTRY_LARGE_PAGE; - } else { - *entry = PDE32_T_ADDR(*pde_entry); - return PDE32_ENTRY_PTE32; - } - } - return PDE32_ENTRY_NOT_PRESENT; + return PT_ENTRY_LARGE_PAGE; + } else { + *entry = BASE_TO_PAGE_ADDR(pde_entry->pt_base_addr); + return PT_ENTRY_PAGE; + } } /* Takes a virtual addr (addr) and returns the physical addr (entry) as defined in the page table */ -int pte32_lookup(pte32_t * pt, addr_t addr, addr_t * entry) { +pt_entry_type_t pte32_lookup(pte32_t * pt, addr_t addr, addr_t * entry) { pte32_t * pte_entry = &(pt[PTE32_INDEX(addr)]); if (!pte_entry->present) { *entry = 0; - PrintDebug("Lookup at non present page (index=%d)\n", PTE32_INDEX(addr)); + // PrintDebug("Lookup at non present page (index=%d)\n", PTE32_INDEX(addr)); + return PT_ENTRY_NOT_PRESENT; + } else { + *entry = BASE_TO_PAGE_ADDR(pte_entry->page_base_addr) + PAGE_OFFSET(addr); + return PT_ENTRY_PAGE; + } + +} + + + +/** + * + * 32 bit PAE Page Table lookup functions + * + **/ +pt_entry_type_t pdpe32pae_lookup(pdpe32pae_t * pdp, addr_t addr, addr_t * entry) { + pdpe32pae_t * pdpe_entry = &(pdp[PDPE32PAE_INDEX(addr)]); + + if (!pdpe_entry->present) { + *entry = 0; + return PT_ENTRY_NOT_PRESENT; + } else { + *entry = BASE_TO_PAGE_ADDR(pdpe_entry->pd_base_addr); + return PT_ENTRY_PAGE; + } +} + +pt_entry_type_t pde32pae_lookup(pde32pae_t * pd, addr_t addr, addr_t * entry) { + pde32pae_t * pde_entry = &(pd[PDE32PAE_INDEX(addr)]); + + if (!pde_entry->present) { + *entry = 0; + return PT_ENTRY_NOT_PRESENT; + } else if (pde_entry->large_page) { + pde32pae_2MB_t * large_pde = (pde32pae_2MB_t *)pde_entry; + + *entry = BASE_TO_PAGE_ADDR_2MB(large_pde->page_base_addr); + *entry += PAGE_OFFSET_2MB(addr); + + return PT_ENTRY_LARGE_PAGE; + } else { + *entry = BASE_TO_PAGE_ADDR(pde_entry->pt_base_addr); + return PT_ENTRY_PAGE; + } +} + +pt_entry_type_t pte32pae_lookup(pte32pae_t * pt, addr_t addr, addr_t * entry) { + pte32pae_t * pte_entry = &(pt[PTE32PAE_INDEX(addr)]); + + if (!pte_entry->present) { + *entry = 0; + return PT_ENTRY_NOT_PRESENT; + } else { + *entry = BASE_TO_PAGE_ADDR(pte_entry->page_base_addr) + PAGE_OFFSET(addr); + return PT_ENTRY_PAGE; + } +} + + + +/** + * + * 64 bit Page Table lookup functions + * + **/ +pt_entry_type_t pml4e64_lookup(pml4e64_t * pml, addr_t addr, addr_t * entry) { + pml4e64_t * pml_entry = &(pml[PML4E64_INDEX(addr)]); + + if (!pml_entry->present) { + *entry = 0; + return PT_ENTRY_NOT_PRESENT; + } else { + *entry = BASE_TO_PAGE_ADDR(pml_entry->pdp_base_addr); + return PT_ENTRY_PAGE; + } +} + +pt_entry_type_t pdpe64_lookup(pdpe64_t * pdp, addr_t addr, addr_t * entry) { + pdpe64_t * pdpe_entry = &(pdp[PDPE64_INDEX(addr)]); + + if (!pdpe_entry->present) { + *entry = 0; + return PT_ENTRY_NOT_PRESENT; + } else if (pdpe_entry->large_page) { + PrintError("1 Gigabyte pages not supported\n"); + V3_ASSERT(0); return -1; } else { - *entry = PTE32_T_ADDR(*pte_entry) + PT32_PAGE_OFFSET(addr); - return 0; + *entry = BASE_TO_PAGE_ADDR(pdpe_entry->pd_base_addr); + return PT_ENTRY_PAGE; } +} - return -1; +pt_entry_type_t pde64_lookup(pde64_t * pd, addr_t addr, addr_t * entry) { + pde64_t * pde_entry = &(pd[PDE64_INDEX(addr)]); + + if (!pde_entry->present) { + *entry = 0; + return PT_ENTRY_NOT_PRESENT; + } else if (pde_entry->large_page) { + pde64_2MB_t * large_pde = (pde64_2MB_t *)pde_entry; + + *entry = BASE_TO_PAGE_ADDR_2MB(large_pde->page_base_addr); + *entry += PAGE_OFFSET_2MB(addr); + + return PT_ENTRY_LARGE_PAGE; + } else { + *entry = BASE_TO_PAGE_ADDR(pde_entry->pt_base_addr); + return PT_ENTRY_PAGE; + } } +pt_entry_type_t pte64_lookup(pte64_t * pt, addr_t addr, addr_t * entry) { + pte64_t * pte_entry = &(pt[PTE64_INDEX(addr)]); + + if (!pte_entry->present) { + *entry = 0; + return PT_ENTRY_NOT_PRESENT; + } else { + *entry = BASE_TO_PAGE_ADDR(pte_entry->page_base_addr) + PAGE_OFFSET(addr); + return PT_ENTRY_PAGE; + } +} + + + + + + + + + + + + + + + pt_access_status_t can_access_pde32(pde32_t * pde, addr_t addr, pf_error_t access_type) { pde32_t * entry = &pde[PDE32_INDEX(addr)]; if (entry->present == 0) { - return PT_ENTRY_NOT_PRESENT; + return PT_ACCESS_NOT_PRESENT; } else if ((entry->writable == 0) && (access_type.write == 1)) { - return PT_WRITE_ERROR; + return PT_ACCESS_WRITE_ERROR; } else if ((entry->user_page == 0) && (access_type.user == 1)) { // Check CR0.WP? - return PT_USER_ERROR; + return PT_ACCESS_USER_ERROR; } return PT_ACCESS_OK; @@ -151,12 +342,12 @@ pt_access_status_t can_access_pte32(pte32_t * pte, addr_t addr, pf_error_t acces pte32_t * entry = &pte[PTE32_INDEX(addr)]; if (entry->present == 0) { - return PT_ENTRY_NOT_PRESENT; + return PT_ACCESS_NOT_PRESENT; } else if ((entry->writable == 0) && (access_type.write == 1)) { - return PT_WRITE_ERROR; + return PT_ACCESS_WRITE_ERROR; } else if ((entry->user_page == 0) && (access_type.user == 1)) { // Check CR0.WP? - return PT_USER_ERROR; + return PT_ACCESS_USER_ERROR; } return PT_ACCESS_OK; @@ -253,7 +444,7 @@ pde32_t * create_passthrough_pts_32(struct guest_info * guest_info) { pde[i].large_page = 0; pde[i].global_page = 0; pde[i].vmm_info = 0; - pde[i].pt_base_addr = PAGE_ALIGNED_ADDR((addr_t)V3_PAddr(pte)); + pde[i].pt_base_addr = PAGE_BASE_ADDR((addr_t)V3_PAddr(pte)); } } @@ -266,7 +457,7 @@ pde32_t * create_passthrough_pts_32(struct guest_info * guest_info) { * pulling pages from the mem_list when necessary * If there are any gaps in the layout, we add them as unmapped pages */ -pdpe32pae_t * create_passthrough_pts_PAE32(struct guest_info * guest_info) { +pdpe32pae_t * create_passthrough_pts_32PAE(struct guest_info * guest_info) { addr_t current_page_addr = 0; int i, j, k; struct shadow_map * map = &(guest_info->mem_map); @@ -360,7 +551,7 @@ pdpe32pae_t * create_passthrough_pts_PAE32(struct guest_info * guest_info) { pde[j].large_page = 0; pde[j].global_page = 0; pde[j].vmm_info = 0; - pde[j].pt_base_addr = PAGE_ALIGNED_ADDR((addr_t)V3_PAddr(pte)); + pde[j].pt_base_addr = PAGE_BASE_ADDR((addr_t)V3_PAddr(pte)); pde[j].rsvd = 0; pde_present = 1; @@ -390,7 +581,7 @@ pdpe32pae_t * create_passthrough_pts_PAE32(struct guest_info * guest_info) { pdpe[i].avail = 0; pdpe[i].rsvd2 = 0; pdpe[i].vmm_info = 0; - pdpe[i].pd_base_addr = PAGE_ALIGNED_ADDR((addr_t)V3_PAddr(pde)); + pdpe[i].pd_base_addr = PAGE_BASE_ADDR((addr_t)V3_PAddr(pde)); pdpe[i].rsvd3 = 0; } @@ -416,7 +607,7 @@ pml4e64_t * create_passthrough_pts_64(struct guest_info * info) { int pdpe_present = 0; pdpe64_t * pdpe = V3_VAddr(V3_AllocPages(1)); - for (j = 0; j < 1; j++) { + for (j = 0; j < 20; j++) { int pde_present = 0; pde64_t * pde = V3_VAddr(V3_AllocPages(1)); @@ -466,7 +657,7 @@ pml4e64_t * create_passthrough_pts_64(struct guest_info * info) { return NULL; } - pte[m].page_base_addr = PTE64_BASE_ADDR(host_addr); + pte[m].page_base_addr = PAGE_BASE_ADDR(host_addr); //PrintPTE64(current_page_addr, &(pte[m])); @@ -488,7 +679,7 @@ pml4e64_t * create_passthrough_pts_64(struct guest_info * info) { pde[k].write_through = 0; pde[k].cache_disable = 0; pde[k].accessed = 0; - pde[k].reserved = 0; + pde[k].avail = 0; pde[k].large_page = 0; //pde[k].global_page = 0; pde[k].vmm_info = 0; @@ -500,11 +691,11 @@ pml4e64_t * create_passthrough_pts_64(struct guest_info * info) { pde[k].write_through = 0; pde[k].cache_disable = 0; pde[k].accessed = 0; - pde[k].reserved = 0; + pde[k].avail = 0; pde[k].large_page = 0; //pde[k].global_page = 0; pde[k].vmm_info = 0; - pde[k].pt_base_addr = PAGE_ALIGNED_ADDR((addr_t)V3_PAddr(pte)); + pde[k].pt_base_addr = PAGE_BASE_ADDR((addr_t)V3_PAddr(pte)); pde_present = 1; } @@ -519,7 +710,7 @@ pml4e64_t * create_passthrough_pts_64(struct guest_info * info) { pdpe[j].write_through = 0; pdpe[j].cache_disable = 0; pdpe[j].accessed = 0; - pdpe[j].reserved = 0; + pdpe[j].avail = 0; pdpe[j].large_page = 0; //pdpe[j].global_page = 0; pdpe[j].vmm_info = 0; @@ -531,11 +722,11 @@ pml4e64_t * create_passthrough_pts_64(struct guest_info * info) { pdpe[j].write_through = 0; pdpe[j].cache_disable = 0; pdpe[j].accessed = 0; - pdpe[j].reserved = 0; + pdpe[j].avail = 0; pdpe[j].large_page = 0; //pdpe[j].global_page = 0; pdpe[j].vmm_info = 0; - pdpe[j].pd_base_addr = PAGE_ALIGNED_ADDR((addr_t)V3_PAddr(pde)); + pdpe[j].pd_base_addr = PAGE_BASE_ADDR((addr_t)V3_PAddr(pde)); pdpe_present = 1; @@ -570,7 +761,7 @@ pml4e64_t * create_passthrough_pts_64(struct guest_info * info) { //pml[i].large_page = 0; //pml[i].global_page = 0; pml[i].vmm_info = 0; - pml[i].pdp_base_addr = PAGE_ALIGNED_ADDR((addr_t)V3_PAddr(pdpe)); + pml[i].pdp_base_addr = PAGE_BASE_ADDR((addr_t)V3_PAddr(pdpe)); } } @@ -580,227 +771,3 @@ pml4e64_t * create_passthrough_pts_64(struct guest_info * info) { - -void PrintPDE32(addr_t virtual_address, pde32_t * pde) -{ - PrintDebug("PDE %p -> %p : present=%x, writable=%x, user=%x, wt=%x, cd=%x, accessed=%x, reserved=%x, largePages=%x, globalPage=%x, kernelInfo=%x\n", - (void *)virtual_address, - (void *)(addr_t) (pde->pt_base_addr << PAGE_POWER), - pde->present, - pde->writable, - pde->user_page, - pde->write_through, - pde->cache_disable, - pde->accessed, - pde->reserved, - pde->large_page, - pde->global_page, - pde->vmm_info); -} - - -void PrintPTE32(addr_t virtual_address, pte32_t * pte) -{ - PrintDebug("PTE %p -> %p : present=%x, writable=%x, user=%x, wt=%x, cd=%x, accessed=%x, dirty=%x, pteAttribute=%x, globalPage=%x, vmm_info=%x\n", - (void *)virtual_address, - (void*)(addr_t)(pte->page_base_addr << PAGE_POWER), - pte->present, - pte->writable, - pte->user_page, - pte->write_through, - pte->cache_disable, - pte->accessed, - pte->dirty, - pte->pte_attr, - pte->global_page, - pte->vmm_info); -} - - - - - - -void PrintPDE64(addr_t virtual_address, pde64_t * pde) -{ - PrintDebug("PDE64 %p -> %p : present=%x, writable=%x, user=%x, wt=%x, cd=%x, accessed=%x, reserved=%x, largePages=%x, globalPage=%x, kernelInfo=%x\n", - (void *)virtual_address, - (void *)(addr_t) (pde->pt_base_addr << PAGE_POWER), - pde->present, - pde->writable, - pde->user_page, - pde->write_through, - pde->cache_disable, - pde->accessed, - pde->reserved, - pde->large_page, - 0,//pde->global_page, - pde->vmm_info); -} - - -void PrintPTE64(addr_t virtual_address, pte64_t * pte) -{ - PrintDebug("PTE64 %p -> %p : present=%x, writable=%x, user=%x, wt=%x, cd=%x, accessed=%x, dirty=%x, pteAttribute=%x, globalPage=%x, vmm_info=%x\n", - (void *)virtual_address, - (void*)(addr_t)(pte->page_base_addr << PAGE_POWER), - pte->present, - pte->writable, - pte->user_page, - pte->write_through, - pte->cache_disable, - pte->accessed, - pte->dirty, - pte->pte_attr, - pte->global_page, - pte->vmm_info); -} - - - - - - -void PrintPD32(pde32_t * pde) -{ - int i; - - PrintDebug("Page Directory at %p:\n", pde); - for (i = 0; (i < MAX_PDE32_ENTRIES); i++) { - if ( pde[i].present) { - PrintPDE32((addr_t)(PAGE_SIZE * MAX_PTE32_ENTRIES * i), &(pde[i])); - } - } -} - -void PrintPT32(addr_t starting_address, pte32_t * pte) -{ - int i; - - PrintDebug("Page Table at %p:\n", pte); - for (i = 0; (i < MAX_PTE32_ENTRIES) ; i++) { - if (pte[i].present) { - PrintPTE32(starting_address + (PAGE_SIZE * i), &(pte[i])); - } - } -} - - - - - - - -void PrintDebugPageTables(pde32_t * pde) -{ - int i; - - PrintDebug("Dumping the pages starting with the pde page at %p\n", pde); - - for (i = 0; (i < MAX_PDE32_ENTRIES); i++) { - if (pde[i].present) { - PrintPDE32((addr_t)(PAGE_SIZE * MAX_PTE32_ENTRIES * i), &(pde[i])); - PrintPT32((addr_t)(PAGE_SIZE * MAX_PTE32_ENTRIES * i), (pte32_t *)V3_VAddr((void *)(addr_t)(pde[i].pt_base_addr << PAGE_POWER))); - } - } -} - - - - - - - - -void PrintPDPE32PAE(addr_t virtual_address, pdpe32pae_t * pdpe) -{ - PrintDebug("PDPE %p -> %p : present=%x, wt=%x, cd=%x, accessed=%x, kernelInfo=%x\n", - (void *)virtual_address, - (void *)(addr_t) (pdpe->pd_base_addr << PAGE_POWER), - pdpe->present, - pdpe->write_through, - pdpe->cache_disable, - pdpe->accessed, - pdpe->vmm_info); -} - -void PrintPDE32PAE(addr_t virtual_address, pde32pae_t * pde) -{ - PrintDebug("PDE %p -> %p : present=%x, writable=%x, user=%x, wt=%x, cd=%x, accessed=%x, largePages=%x, globalPage=%x, kernelInfo=%x\n", - (void *)virtual_address, - (void *)(addr_t) (pde->pt_base_addr << PAGE_POWER), - pde->present, - pde->writable, - pde->user_page, - pde->write_through, - pde->cache_disable, - pde->accessed, - pde->large_page, - pde->global_page, - pde->vmm_info); -} - - -void PrintPTE32PAE(addr_t virtual_address, pte32pae_t * pte) -{ - PrintDebug("PTE %p -> %p : present=%x, writable=%x, user=%x, wt=%x, cd=%x, accessed=%x, dirty=%x, pteAttribute=%x, globalPage=%x, vmm_info=%x\n", - (void *)virtual_address, - (void*)(addr_t)(pte->page_base_addr << PAGE_POWER), - pte->present, - pte->writable, - pte->user_page, - pte->write_through, - pte->cache_disable, - pte->accessed, - pte->dirty, - pte->pte_attr, - pte->global_page, - pte->vmm_info); -} - - - - - - -void PrintDebugPageTables32PAE(pdpe32pae_t * pdpe) -{ - int i, j, k; - pde32pae_t * pde; - pte32pae_t * pte; - addr_t virtual_addr = 0; - - PrintDebug("Dumping the pages starting with the pde page at %p\n", pdpe); - - for (i = 0; (i < MAX_PDPE32PAE_ENTRIES); i++) { - - if (pdpe[i].present) { - pde = (pde32pae_t *)V3_VAddr((void *)(addr_t)BASE_TO_PAGE_ADDR(pdpe[i].pd_base_addr)); - - PrintPDPE32PAE(virtual_addr, &(pdpe[i])); - - for (j = 0; j < MAX_PDE32PAE_ENTRIES; j++) { - - if (pde[j].present) { - pte = (pte32pae_t *)V3_VAddr((void *)(addr_t)BASE_TO_PAGE_ADDR(pde[j].pt_base_addr)); - - PrintPDE32PAE(virtual_addr, &(pde[j])); - - for (k = 0; k < MAX_PTE32PAE_ENTRIES; k++) { - if (pte[k].present) { - PrintPTE32PAE(virtual_addr, &(pte[k])); - } - - virtual_addr += PAGE_SIZE; - } - } else { - virtual_addr += PAGE_SIZE * MAX_PTE32PAE_ENTRIES; - } - } - } else { - virtual_addr += PAGE_SIZE * MAX_PDE32PAE_ENTRIES * MAX_PTE32PAE_ENTRIES; - } - } -} - -