carta
pmap_quick_remove_page(9freebsd)

pmap_quick_remove_page9freebsd

Manage fast, single-page kernel address space mappings

Part of pmap_quick_enter_page(9freebsd).

Usage

vm_offset_t

void

Overview

The pmap_quick_enter_page() function accepts a single page m, and enters this page into a preallocated address in kernel virtual address (KVA) space. This function is intended for temporary mappings that will only be used for a very short period, for example a copy operation on the page contents.

The pmap_quick_remove_page() function removes a mapping previously created by pmap_quick_enter_page() at kva, making the KVA frame used by pmap_quick_enter_page() available for reuse.

On many architectures, pmap_quick_enter_page() uses a per-CPU pageframe. In those cases, it must disable preemption on the local CPU. The corresponding call to pmap_quick_remove_page() then re-enables preemption. It is therefore not safe for machine-independent code to sleep or perform locking operations while holding these mappings. Current implementations only guarantee the availability of a single page for the calling thread, so calls to pmap_quick_enter_page() must not be nested.

pmap_quick_enter_page() and pmap_quick_remove_page() do not sleep, and pmap_quick_enter_page() always returns a valid address. It is safe to use these functions under all types of locks except spin mutexes. It is also safe to use them in all thread contexts except primary interrupt context.

The page must not be swapped or otherwise reused while the mapping is active. It must be either wired or held, or it must belong to an unmanaged region such as I/O device memory.

Return values

The pmap_quick_enter_page() function returns the kernel virtual address that is mapped to the page m.

History

  • Debian 13 (Trixie) to Debian 11 (Bullseye): the text shown here
  • Debian 10 (Buster)
  • Debian 9 (Stretch)

Authors

This manual page was written by Jason A Harmening ⟨[email protected]⟩.

From freebsd-manpages 12.2-2 in Debian 13 (Trixie). Parsed by carta from the page's mdoc source.