* Abuse the pte2 nodes for unmapped kva to thread a kva freelist through. * Requirements: * - Must deal with pages in order to ensure that none of the PTE2_* bits * are ever set, PTE2_V in particular. * - Assumes we can write to pte2s without pte2_store() atomic ops. * - Assumes nothing will ever test these addresses for 0 to indicate * no mapping instead of correctly checkin
| 1498 | * Because PTE2_V is never set, there can be no mappings to invalidate. |
| 1499 | */ |
| 1500 | static vm_offset_t |
| 1501 | pmap_pte2list_alloc(vm_offset_t *head) |
| 1502 | { |
| 1503 | pt2_entry_t *pte2p; |
| 1504 | vm_offset_t va; |
| 1505 | |
| 1506 | va = *head; |
| 1507 | if (va == 0) |
| 1508 | panic("pmap_ptelist_alloc: exhausted ptelist KVA"); |
| 1509 | pte2p = pt2map_entry(va); |
| 1510 | *head = *pte2p; |
| 1511 | if (*head & PTE2_V) |
| 1512 | panic("%s: va with PTE2_V set!", __func__); |
| 1513 | *pte2p = 0; |
| 1514 | return (va); |
| 1515 | } |
| 1516 | |
| 1517 | static void |
| 1518 | pmap_pte2list_free(vm_offset_t *head, vm_offset_t va) |
no test coverage detected