Lines Matching refs:pmap
98 ** This function verifies and returns the pmap for an address space.
99 ** If there is none and the request is valid, a pmap will be created.
106 ** address of a pmap or 0 if not found or could no be created
107 ** Note that if there is no pmap for the address space it will be created.
112 pmap_t pmap;
117 pmap = act->machine.vmmControl->vmmAdsp[index - 1]; /* Get the pmap */
118 return (pmap); /* and return it. */
129 static pmap_vmm_ext *vmm_build_shadow_hash(pmap_t pmap)
131 pmap_vmm_ext *ext; /* VMM pmap extension we're building */
132 ppnum_t extPP; /* VMM pmap extension physical page number */
156 ext->vmxHostPmapPhys = (addr64_t)(vm_offset_t)pmap ^ pmap->pmapvr;
157 /* Set host pmap's physical address */
158 ext->vmxHostPmap = pmap; /* Set host pmap's effective address */
188 return (ext); /* Return newly-minted VMM pmap extension */
196 kmem_free(kernel_map, (vm_offset_t)ext, PAGE_SIZE); /* Release the VMM pmap extension page */
215 kmem_free(kernel_map, (vm_offset_t)ext, PAGE_SIZE); /* Release the VMM pmap extension page */
244 hpmap = act->map->pmap; /* Get host pmap */
245 gpmap = vmm_get_adsp(act, index); /* Get guest pmap */
288 gpmap = vmm_get_adsp(act, index); /* Get guest pmap */
466 ** a new pmap (address space) and fills in the initial processor
591 conphys = pmap_find_phys(act->map->pmap, (addr64_t)((uintptr_t)vmm_user_state));
634 hpmap = act->map->pmap; /* Get host pmap */
635 gpmap = pmap_create(0, FALSE); /* Make a fresh guest pmap */
637 CTable->vmmAdsp[cvi] = gpmap; /* Remember guest pmap for new context */
642 ret = KERN_RESOURCE_SHORTAGE; /* We've failed to allocate a guest pmap */
692 pmap_t pmap;
713 /* Get context's guest pmap (if any) */
721 pmap_destroy(gpmap); /* Toss the pmap for this context */
764 pmap_destroy(act->machine.vmmControl->vmmAdsp[index - 1]); /* Toss the pmap for this context */
768 pmap = act->map->pmap; /* Get our pmap */
769 if (pmap->pmapVmmExt) { /* Release any VMM pmap extension block and shadow hash table */
770 vmm_release_shadow_hash(pmap->pmapVmmExt); /* Release extension block and shadow hash table */
771 pmap->pmapVmmExt = NULL; /* Forget extension block */
772 pmap->pmapVmmExtPhys = 0; /* Forget extension block's physical address, too */
774 pmap->pmapFlags &= ~pmapVMhost; /* We're no longer hosting */
982 pmap_t pmap;
984 pmap = vmm_get_adsp(act, index); /* Get the guest pmap for this address space */
985 if(!pmap) return KERN_FAILURE; /* Bogus address space, no VMs, or we can't make a pmap, failure... */
991 if (pmap->pmapFlags & pmapVMgsaa) { /* Guest shadow assist active ? */
992 ret = hw_res_map_gv(map->pmap, pmap, cva, ava, getProtPPC(prot, TRUE));
1003 mp = mapping_find(map->pmap, cva, &nextva, 0);
1041 hw_add_map_gv(map->pmap, pmap, gva, mflags, mp->mpPAddr);
1049 mp = mapping_find(map->pmap, cva, &nextva, 0); /* Find the mapping for this address */
1071 ova = mapping_make(pmap, ava, mp->mpPAddr, 0, 1, prot); /* Enter the mapping into the pmap */
1073 mapping_remove(pmap, ova); /* Remove the mapping that collided */
1240 pmap_t pmap;
1244 pmap = vmm_get_adsp(act, index); /* Get and validate the index */
1245 if (!pmap)return -1; /* No good, failure... */
1247 if (pmap->pmapFlags & pmapVMgsaa) { /* Guest shadow assist (GSA) active ? */
1248 return (hw_gva_to_hva(pmap, gva)); /* Convert guest to host virtual address */
1250 mp = mapping_find(pmap, gva, &nextva, 0); /* Find guest mapping for this virtual address */
1258 pmap = current_thread()->map->pmap; /* Get the host pmap */
1259 hva = mapping_p2v(pmap, pa); /* Now find the source virtual */
1291 pmap_t pmap;
1293 pmap = vmm_get_adsp(act, index); /* Get and validate the index */
1294 if (!pmap)return -1; /* No good, failure... */
1296 if (pmap->pmapFlags & pmapVMgsaa) { /* Handle guest shadow assist specially */
1297 hw_susp_map_gv(act->map->pmap, pmap, va); /* Suspend the mapping */
1300 nadd = mapping_remove(pmap, va); /* Toss the mapping */
1336 pmap_t pmap;
1368 pmap = act->machine.vmmControl->vmmAdsp[adsp]; /* Get the pmap for this request */
1369 if(!pmap)
1373 if (pmap->pmapFlags & pmapVMgsaa) { /* Handle guest shadow assist specially */
1374 hw_susp_map_gv(act->map->pmap, pmap, gva);
1377 (void)mapping_remove(pmap, gva); /* Toss the mapping */
1399 ** All pages are unmapped, but the address space (i.e., pmap) is still alive
1406 pmap_t pmap;
1408 pmap = vmm_get_adsp(act, index); /* Convert index to entry */
1409 if (!pmap) return; /* Either this isn't vmm thread or the index is bogus */
1411 if (pmap->pmapFlags & pmapVMgsaa) { /* Handle guest shadow assist specially */
1412 hw_rem_all_gv(pmap); /* Remove all guest's mappings from shadow hash table */
1415 * Note: the pmap code won't deal with the last page in the address space, so handle it explicitly
1417 mapping_remove(pmap, 0xFFFFFFFFFFFFF000LL); /* Remove final page explicitly because we might have mapped it */
1418 pmap_remove(pmap, 0, 0xFFFFFFFFFFFFF000LL); /* Remove all entries from this map */
1451 pmap_t pmap;
1453 pmap = vmm_get_adsp(act, index); /* Convert index to entry */
1454 if (!pmap) return 1; /* Either this isn't vmm thread or the index is bogus */
1456 if (pmap->pmapFlags & pmapVMgsaa) { /* Handle guest shadow assist specially */
1457 RC = hw_test_rc_gv(act->map->pmap, pmap, va, reset);/* Fetch the RC bits and clear if requested */
1459 RC = hw_test_rc(pmap, (addr64_t)va, reset); /* Fetch the RC bits and clear if requested */
1473 panic("vmm_get_page_dirty_flag: hw_test_rc failed - rc = %d, pmap = %p, va = %016llX\n", RC, pmap, va);
1507 pmap_t pmap;
1509 pmap = vmm_get_adsp(act, index); /* Convert index to entry */
1510 if (!pmap) return KERN_FAILURE; /* Either this isn't vmm thread or the index is bogus */
1512 if (pmap->pmapFlags & pmapVMgsaa) { /* Handle guest shadow assist specially */
1513 ret = hw_protect_gv(pmap, va, prot); /* Try to change protection, GSA varient */
1515 ret = hw_protect(pmap, va, prot, &nextva); /* Try to change protection */
1528 panic("vmm_protect_page: hw_protect failed - rc = %d, pmap = %p, va = %016llX\n", ret, pmap, (addr64_t)va);