Lines Matching refs:pv
674 * Data for the pv entry allocation mechanism.
1164 pv_to_chunk(pv_entry_t pv)
1167 return ((struct pv_chunk *)((uintptr_t)pv & ~(uintptr_t)PAGE_MASK));
1170 #define PV_PMAP(pv) (pv_to_chunk(pv)->pc_pmap)
1252 * First find and then remove the pv entry for the specified pmap and virtual
1253 * address from the specified pv list. Returns the pv entry if found and NULL
1254 * otherwise. This operation can be performed on pv lists for either 4KB or
1260 pv_entry_t pv;
1262 TAILQ_FOREACH(pv, &pvh->pv_list, pv_link) {
1264 if (PV_PMAP(pv) == NULL) {
1265 printf("corrupted pv_chunk/pv %p\n", pv);
1266 printf("pv_chunk: %64D\n", pv_to_chunk(pv), ":");
1268 MPASS(PV_PMAP(pv) != NULL);
1269 MPASS(pv->pv_va != 0);
1271 if (pmap == PV_PMAP(pv) && va == pv->pv_va) {
1272 TAILQ_REMOVE(&pvh->pv_list, pv, pv_link);
1277 return (pv);
1282 * destroy the pv entry for the 2MB page mapping and reinstantiate the pv
1291 pv_entry_t pv;
1302 * Transfer the 2mpage's pv entry for this mapping to the first
1303 * page's pv list. Once this transfer begins, the pv list lock
1304 * must not be released until the last pv entry is reinstantiated.
1308 pv = pmap_pvh_remove(pvh, pmap, va);
1309 KASSERT(pv != NULL, ("pmap_pv_demote_pde: pv not found"));
1311 TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_link);
1314 /* Instantiate the remaining NPTEPG - 1 pv entries. */
1325 pv = &pc->pc_pventry[field * 64 + bit];
1327 pv->pv_va = va;
1331 TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_link);
1364 * another pv entry chunk.
1369 * allocate per-page pv entries until repromotion occurs, thereby
1370 * exacerbating the shortage of free pv entries.
1382 pv_entry_t pv;
1455 pv = &pc->pc_pventry[field * 64 + bit];
1456 va = pv->pv_va;
1470 TAILQ_REMOVE(&m->md.pv_list, pv, pv_link);
1509 /* One freed pv entry in locked_pmap is sufficient. */
1517 * Rotate the pv chunks list so that we do not
1518 * scan the same pv chunks that could not be
1549 free_pv_entry(pmap_t pmap, pv_entry_t pv)
1556 printf("%s(%p, %p)\n", __func__, pmap, pv);
1562 pc = pv_to_chunk(pv);
1563 idx = pv - &pc->pc_pventry[0];
1609 pv_entry_t pv;
1625 pv = &pc->pc_pventry[field * 64 + bit];
1635 MPASS(PV_PMAP(pv) != NULL);
1636 return (pv);
1660 pv = &pc->pc_pventry[0];
1664 MPASS(PV_PMAP(pv) != NULL);
1665 return (pv);
1671 * replace the many pv entries for the 4KB page mappings by a single pv entry
1679 pv_entry_t pv;
1688 * Transfer the first page's pv entry for this mapping to the 2mpage's
1689 * pv list. Aside from avoiding the cost of a call to get_pv_entry(),
1696 pv = pmap_pvh_remove(&m->md, pmap, va);
1697 KASSERT(pv != NULL, ("pmap_pv_promote_pde: pv not found"));
1699 TAILQ_INSERT_TAIL(&pvh->pv_list, pv, pv_link);
1701 /* Free the remaining NPTEPG - 1 pv entries. */
1712 * First find and then destroy the pv entry for the specified pmap and virtual
1713 * address. This operation can be performed on pv lists for either 4KB or 2MB
1719 pv_entry_t pv;
1721 pv = pmap_pvh_remove(pvh, pmap, va);
1722 KASSERT(pv != NULL, ("pmap_pvh_free: pv not found"));
1723 free_pv_entry(pmap, pv);
1734 pv_entry_t pv;
1738 if ((pv = get_pv_entry(pmap, NULL)) != NULL) {
1739 pv->pv_va = va;
1741 TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_link);
2429 pv_entry_t next_pv, pv;
2453 TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_link, next_pv) {
2454 pmap = PV_PMAP(pv);
2465 va = pv->pv_va;
2489 TAILQ_FOREACH(pv, &m->md.pv_list, pv_link) {
2490 pmap = PV_PMAP(pv);
2502 l3e = pmap_pml3e(pmap, pv->pv_va);
2504 " a 2mpage in page %p's pv list", m));
2505 pte = pmap_l3e_to_pte(l3e, pv->pv_va);
2508 pmap_invalidate_page(pmap, pv->pv_va);
2808 * Promote the pv entries.
2833 pv_entry_t pv;
2927 pv = NULL;
3019 pv = pmap_pvh_remove(&om->md, pmap, va);
3021 free_pv_entry(pmap, pv);
3024 if (pv == NULL) {
3028 MPASS(pv != NULL);
3064 if (pv == NULL) {
3065 pv = get_pv_entry(pmap, &lock);
3066 pv->pv_va = va;
3070 printf("reassigning pv: %p to pmap: %p\n",
3071 pv, pmap);
3074 TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_link);
3717 * Initialize the pv chunk list mutex.
3719 mtx_init(&pv_chunks_mutex, "pmap pv chunk list", NULL, MTX_DEF);
3722 * Initialize the pool of pv list locks.
3725 rw_init(&pv_list_locks[i], "pmap pv list");
3728 * Calculate the size of the pv head table for superpages.
3733 * Allocate memory for the pv head table for superpages.
3757 pv_entry_t pv;
3768 TAILQ_FOREACH(pv, &m->md.pv_list, pv_link) {
3769 pmap = PV_PMAP(pv);
3780 pte = pmap_pte(pmap, pv->pv_va);
3793 TAILQ_FOREACH(pv, &pvh->pv_list, pv_link) {
3794 pmap = PV_PMAP(pv);
3807 pte = pmap_pml3e(pmap, pv->pv_va);
3898 pv_entry_t pv, pvf;
3920 pv = pvf;
3923 pvf = pv;
3924 pmap = PV_PMAP(pv);
3935 l3e = pmap_pml3e(pmap, pv->pv_va);
3964 if ((((pa >> PAGE_SHIFT) ^ (pv->pv_va >> L3_PAGE_SIZE_SHIFT) ^
3968 pmap_invalidate_page(pmap, pv->pv_va);
3971 ("inconsistent pv lock %p %p for page %p",
3978 if (pv != NULL && TAILQ_NEXT(pv, pv_link) != NULL) {
3979 TAILQ_REMOVE(&pvh->pv_list, pv, pv_link);
3980 TAILQ_INSERT_TAIL(&pvh->pv_list, pv, pv_link);
3985 } while ((pv = TAILQ_FIRST(&pvh->pv_list)) != pvf);
3989 pv = pvf;
3992 pvf = pv;
3993 pmap = PV_PMAP(pv);
4005 l3e = pmap_pml3e(pmap, pv->pv_va);
4007 ("pmap_ts_referenced: found a 2mpage in page %p's pv list",
4009 pte = pmap_l3e_to_pte(l3e, pv->pv_va);
4014 pmap_invalidate_page(pmap, pv->pv_va);
4019 if (pv != NULL && TAILQ_NEXT(pv, pv_link) != NULL) {
4020 TAILQ_REMOVE(&m->md.pv_list, pv, pv_link);
4021 TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_link);
4024 } while ((pv = TAILQ_FIRST(&m->md.pv_list)) != pvf && cleared +
4132 pv_entry_t pv;
4142 TAILQ_FOREACH(pv, &m->md.pv_list, pv_link) {
4143 if (PV_PMAP(pv) == pmap) {
4153 TAILQ_FOREACH(pv, &pvh->pv_list, pv_link) {
4154 if (PV_PMAP(pv) == pmap) {
4183 pv_entry_t pv;
4193 TAILQ_FOREACH(pv, &m->md.pv_list, pv_link) {
4194 pmap = PV_PMAP(pv);
4205 pte = pmap_pte(pmap, pv->pv_va);
4212 TAILQ_FOREACH(pv, &pvh->pv_list, pv_link) {
4213 pmap = PV_PMAP(pv);
4226 pte = pmap_pml3e(pmap, pv->pv_va);
4883 pv_entry_t pv;
4888 if ((pv = get_pv_entry(pmap, (flags & PMAP_ENTER_NORECLAIM) != 0 ?
4891 pv->pv_va = va;
4895 TAILQ_INSERT_TAIL(&pvh->pv_list, pv, pv_link);
5337 pv_entry_t pv;
5355 while ((pv = TAILQ_FIRST(&pvh->pv_list)) != NULL) {
5356 pmap = PV_PMAP(pv);
5368 va = pv->pv_va;
5373 while ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) {
5374 pmap = PV_PMAP(pv);
5388 l3e = pmap_pml3e(pmap, pv->pv_va);
5390 " a 2mpage in page %p's pv list", m));
5391 pte = pmap_l3e_to_pte(l3e, pv->pv_va);
5403 pmap_unuse_pt(pmap, pv->pv_va, be64toh(*l3e), &free);
5404 pmap_invalidate_page(pmap, pv->pv_va);
5405 TAILQ_REMOVE(&m->md.pv_list, pv, pv_link);
5407 free_pv_entry(pmap, pv);
5450 pv_entry_t pv;
5487 pv = &pc->pc_pventry[idx];
5490 pte = pmap_pml2e(pmap, pv->pv_va);
5492 pte = pmap_l2e_to_l3e(pte, pv->pv_va);
5499 pte = &pte[pmap_pte_index(pv->pv_va)];
5517 pv->pv_va, tpte);
5564 TAILQ_REMOVE(&pvh->pv_list, pv, pv_link);
5572 mpte = pmap_remove_pt_page(pmap, pv->pv_va);
5583 printf("freeing pv (%p, %p)\n",
5584 pmap, pv);
5586 TAILQ_REMOVE(&m->md.pv_list, pv, pv_link);
5596 pmap_unuse_pt(pmap, pv->pv_va, ptel3e, &free);
5623 pv_entry_t next_pv, pv;
5640 TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_link, next_pv) {
5641 pmap = PV_PMAP(pv);
5653 l3e = pmap_pml3e(pmap, pv->pv_va);
5655 (void)pmap_demote_l3e_locked(pmap, l3e, pv->pv_va, &lock);
5657 ("inconsistent pv lock %p %p for page %p",
5661 TAILQ_FOREACH(pv, &m->md.pv_list, pv_link) {
5662 pmap = PV_PMAP(pv);
5676 l3e = pmap_pml3e(pmap, pv->pv_va);
5678 ("pmap_remove_write: found a 2mpage in page %p's pv list",
5680 pte = pmap_l3e_to_pte(l3e, pv->pv_va);
5689 pmap_invalidate_page(pmap, pv->pv_va);
6507 pv_entry_t pv;
6511 TAILQ_FOREACH(pv, &m->md.pv_list, pv_link) {
6512 db_printf("pv: %p ", pv);
6513 db_printf("va: %#016lx ", pv->pv_va);
6514 pmap = PV_PMAP(pv);
6518 pmap_pte_walk(pmap->pm_pml1, pv->pv_va);