MCPcopy Create free account
hub / github.com/F-Stack/f-stack / pmap_update_entry

Function pmap_update_entry

freebsd/arm64/arm64/pmap.c:3439–3467  ·  view source on GitHub ↗

* Performs a break-before-make update of a pmap entry. This is needed when * either promoting or demoting pages to ensure the TLB doesn't get into an * inconsistent state. */

Source from the content-addressed store, hash-verified

3437 * inconsistent state.
3438 */
3439static void
3440pmap_update_entry(pmap_t pmap, pd_entry_t *pte, pd_entry_t newpte,
3441 vm_offset_t va, vm_size_t size)
3442{
3443 register_t intr;
3444
3445 PMAP_LOCK_ASSERT(pmap, MA_OWNED);
3446
3447 /*
3448 * Ensure we don't get switched out with the page table in an
3449 * inconsistent state. We also need to ensure no interrupts fire
3450 * as they may make use of an address we are about to invalidate.
3451 */
3452 intr = intr_disable();
3453
3454 /*
3455 * Clear the old mapping's valid bit, but leave the rest of the entry
3456 * unchanged, so that a lockless, concurrent pmap_kextract() can still
3457 * lookup the physical address.
3458 */
3459 pmap_clear_bits(pte, ATTR_DESCR_VALID);
3460 pmap_invalidate_range(pmap, va, va + size);
3461
3462 /* Create the new mapping */
3463 pmap_store(pte, newpte);
3464 dsb(ishst);
3465
3466 intr_restore(intr);
3467}
3468
3469#if VM_NRESERVLEVEL > 0
3470/*

Callers 4

pmap_promote_l2Function · 0.85
pmap_change_attr_lockedFunction · 0.85
pmap_demote_l1Function · 0.85
pmap_demote_l2_lockedFunction · 0.85

Calls 3

pmap_invalidate_rangeFunction · 0.70
intr_disableFunction · 0.50
intr_restoreFunction · 0.50

Tested by

no test coverage detected