Skip to main content

Module kvirt_store

Module kvirt_store 

Source
Expand description

Kernel-side one-step-soundness store for the kernel virtual area API ([crate::mm::kspace::kvirt_area::KVirtArea]) — the kernel analog of super::VmStore.

§Why a separate, kernel store

super::VmStore models a caller of the user VmSpace API: it holds a Map<VmSpaceId, VmSpaceOwner>, each wrapping an OwnerSubtree<UserPtConfig>, plus user-space cursors (CursorOwner<'rcu, UserPtConfig>). KVirtArea instead maps frames into the single, global kernel page table (crate::mm::kspace::KERNEL_PAGE_TABLE, a KernelPtConfig table), so the kernel store differs in three ways:

  • one page table, not a map: a single PageTableOwner<KernelPtConfig> (kernel_pt) rather than Map<VmSpaceId, _>;
  • it tracks the allocated kernel virtual areas (kvirt_areas) — each KVirtArea is just a Range<Vaddr> handle, since its KVirtAreaOwner is consumed into the page table at construction (map_frames/map_untracked_frames take it by value);
  • cursors and owners are over KernelPtConfig, not UserPtConfig (added when the mutating ops land).

§Roadmap

Landed: the store + invariant. Next: step_query (read-only) over kernel_pt, then map_frames / map_untracked_frames (the mapping-creating ops; their exec ensures may need strengthening first). Accounting (the rc == H + P + cover_count equation super::VmStore carries) is deferred — KVirtArea is mapping-focused, not reference-count-focused.

Structs§

KVmStore
One-step-soundness store for the kernel virtual area API. Holds the shared regions, the single global kernel page table kernel_pt, and the set of allocated kernel virtual areas (each a Range<Vaddr> handle — see the module docs).

Functions§

query_embedded

Type Aliases§

KVirtId
Logical identifier for an allocated [KVirtArea] in the store.