rvm-memory 0.1.1

Memory management and guest physical address space for the RVM microhypervisor (ADR-136, ADR-138)
Documentation
  • Coverage
  • 100%
    128 out of 128 items documented0 out of 64 items with examples
  • Size
  • Source code size: 125.12 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.48 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2s Average build duration of successful builds.
  • all releases: 2s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • ruvnet/rvm
    138 29 10
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • ruvnet

rvm-memory

Guest physical address space management for the RVM microhypervisor.

Provides safe abstractions over stage-2 page table mappings with capability-gated access. Each partition has an independent guest physical address space. All mapping operations are recorded in the witness trail. Memory regions can be shared between partitions with explicit grants.

Key Types and Functions

  • MemoryRegion -- descriptor: guest base, host base, page count, permissions, owner
  • MemoryPermissions -- RWX permission flags with constants (READ_ONLY, READ_WRITE, READ_EXECUTE)
  • validate_region(region) -- checks alignment, page count, and permission validity
  • regions_overlap(a, b) -- detects overlapping regions within the same partition
  • PAGE_SIZE -- 4 KiB page size constant

Example

use rvm_memory::{MemoryRegion, MemoryPermissions, validate_region, PAGE_SIZE};
use rvm_types::{GuestPhysAddr, PhysAddr, PartitionId};

let region = MemoryRegion {
    guest_base: GuestPhysAddr::new(0x8000_0000),
    host_base: PhysAddr::new(0x4000_0000),
    page_count: 16,
    permissions: MemoryPermissions::READ_WRITE,
    owner: PartitionId::new(1),
};
assert!(validate_region(&region).is_ok());

Design Constraints

  • DC-15: #![no_std], #![forbid(unsafe_code)], #![deny(missing_docs)]
  • ADR-138: capability-gated mappings; witness-logged operations

Workspace Dependencies

  • rvm-types
  • rvm-hal
  • rvm-partition
  • rvm-witness