Lines Matching refs:pmap
30 * The code herein is primarily used to bridge between the pmap layer and the hardware layer.
31 * Currently, some of the function of this module is contained within pmap.c. We may want to move
57 #include <vm/pmap.h>
62 #include <ppc/pmap.h>
123 * 4, so, we can have 2^20 (2M) unique IDs. Each pmap has a unique space ID, so we should be able
208 * mapping_remove(pmap_t pmap, addr64_t va);
209 * Given a pmap and virtual address, this routine finds the mapping and unmaps it.
221 addr64_t mapping_remove(pmap_t pmap, addr64_t va) { /* Remove a single mapping for this VADDR
231 mp = hw_rem_map(pmap, va, &nextva); /* Remove a mapping from this pmap */
240 panic("mapping_remove: hw_rem_map failed - pmap = %p, va = %016llX, code = %p\n",
241 pmap, va, mp);
249 if ((pmap->pmapFlags & pmapVMhost) && pmap->pmapVmmExt) {
259 mp = hw_scrub_guest(physent, pmap); /* Attempt to scrub a guest mapping */
278 * mapping_make(pmap, va, pa, flags, size, prot) - map a virtual address to a real one
283 * pmap (virtual address) is the pmap to map into
312 addr64_t mapping_make(pmap_t pmap, addr64_t va, ppnum_t pa, unsigned int flags, unsigned int size, vm_prot_t prot) { /* Make an address mapping */
327 panic("mapping_make: invalid physical page configuration request - pmap = %p, va = %016llX, cfg = %d\n",
328 pmap, va, pcf);
333 panic("mapping_make: attempt to map unaligned vaddr - pmap = %p, va = %016llX, cfg = %d\n",
334 pmap, va, pcf);
337 panic("mapping_make: attempt to map unaligned paddr - pmap = %p, pa = %08X, cfg = %d\n",
338 pmap, pa, pcf);
380 nlists = mapSetLists(pmap); /* Set number of lists this will be on */
386 mp->mpSpace = pmap->space; /* Set the address space/pmap lookup ID */
391 if ( !nx_enabled || (pmap->pmapFlags & pmapNXdisabled) )
397 colladdr = hw_add_map(pmap, mp); /* Go add the mapping to the pmap */
406 (void)mapping_remove(pmap, colladdr); /* Lend a helping hand to another CPU doing block removal */
418 panic("mapping_make: hw_add_map failed - collision addr = %016llX, code = %02X, pmap = %p, va = %016llX, mapping = %p\n",
419 colladdr, rc, pmap, va, mp); /* Die dead */
429 * mapping *mapping_find(pmap, va, *nextva, full) - Finds a mapping
445 mapping_t *mapping_find(pmap_t pmap, addr64_t va, addr64_t *nextva, int full) { /* Make an address mapping */
452 curpmap = pmap; /* Remember entry */
460 panic("mapping_find: pmap lock failure - rc = %p, pmap = %p\n", mp, curpmap); /* Die... */
465 if((mp->mpFlags & mpType) != mpNest) { /* Don't chain through anything other than a nested pmap */
472 panic("mapping_find: too many nested pmaps - va = %016llX, curva = %016llX, pmap = %p, curpmap = %p\n",
473 va, curva, pmap, curpmap);
476 curva = curva + mp->mpNestReloc; /* Relocate va to new pmap */
477 curpmap = (pmap_t) pmapTrans[mp->mpSpace].pmapVAddr; /* Get the address of the nested pmap */
486 * void mapping_protect(pmap_t pmap, addt_t va, vm_prot_t prot, addr64_t *nextva) - change the protection of a virtual page
488 * This routine takes a pmap and virtual address and changes
499 mapping_protect(pmap_t pmap, addr64_t va, vm_prot_t prot, addr64_t *nextva) { /* Change protection of a virtual page */
504 if ( !nx_enabled || (pmap->pmapFlags & pmapNXdisabled) )
507 ret = hw_protect(pmap, va, getProtPPC(prot, disable_NX), nextva); /* Try to change the protect here */
514 case mapRtNest: /* Nested pmap, just ignore request */
518 panic("mapping_protect: hw_protect failed - rc = %d, pmap = %p, va = %016llX\n", ret, pmap, va);
1082 /* We don't steal mappings from the kernel pmap, a VMM host pmap, or a VMM guest pmap with guest
1099 panic("mapping_alloc: hw_purge_map failed - pmap = %p, va = %16llX, code = %p\n", ckpmap, va, mp);
1116 panic("no valid pmap to purge mappings\n");
1488 * addr64_t mapping_p2v(pmap_t pmap, ppnum_t pa) - Finds first virtual mapping of a physical page in a space
1491 * list for a matching pmap. It grabs the virtual address from the mapping, drops busy, and returns
1496 addr64_t mapping_p2v(pmap_t pmap, ppnum_t pa) { /* Finds first virtual mapping of a physical page in a space */
1511 mp = hw_find_space(physent, pmap->space); /* Go find the first mapping to the page from the requested pmap */
1641 mp = mapping_find(map->pmap, vaddr, &nextva, 1); /* Find and busy the mapping */