PMAP_QENTER(9)

πŸ’– PMAP_QENTER πŸ’–

okay bestie, so this is PMAP_QENTER(9), a Kernel Developer's Manual page, and it's literally all about managing temporary kernel space mappings. yes, the whole page. no cap. ✨


🌸 NAME 🌸

pmap_qenter, pmap_qremove β€” the duo that manages temporary kernel space mappings 🫢


✨ SYNOPSIS ✨

#include <sys/param.h>
#include <vm/vm.h>
#include <vm/pmap.h>

void
pmap_qenter(vm_offset_t sva, vm_page_t *m, int count);

void
pmap_qremove(vm_offset_t sva, int count);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so pmap_qenter() takes a linear array of count pointers to wired pages *m, and it enters each one of those pages into the kernel virtual address (KVA) space, starting at the address sva. πŸ’…

the pages get mapped non-executable, if possible. and like, key word: if possible. for example, non-PAE i386 simply has no capability to map pages non-executable. it's giving "we tried our best." 😭

then pmap_qremove() does the reverse vibe: it tears out a mapping from the kernel virtual address space, beginning at sva and running for count pages. bye bestie πŸ‘‹


πŸŽ€ IMPLEMENTATION NOTES πŸŽ€

pmap_qenter() is intended for temporary mappings that do not require page modification or reference counting. old mappings are simply overwritten β€” no ceremony, no goodbye, they're just gone. πŸ”₯

and the pages must be wired into physical memory. like, that's not optional, that's the whole thing.

the corresponding pmap_qremove() is intended to remove those temporary mappings. they're a matching set, iykyk. πŸ’œ


🌈 SEE ALSO 🌈


πŸ‘‘ AUTHORS πŸ‘‘

this manual page was written by Bruce M Simpson <bms@spc.org>. thank you king 🫢


and that's the whole thing, bestie ✨ this was the Debian build, dated February 15, 2018, page PMAP_QENTER(9) β€” go map something temporary and slay πŸ’…πŸ’–

πŸ“¦ where this page comes from