Skip to main content

Module layout

Module layout 

Source

Structs§

QueueDims
Validated address independent dimensions for one transport queue.
TransportArena
Addresses of both rings, the checkpoint mailbox, and pools in one fixed arena.

Constants§

SCRATCH_TOP_ALLOCATOR_OFFSET
SCRATCH_TOP_EXN_STACK_OFFSET
SCRATCH_TOP_G2H_BUFFER_SIZE_OFFSET
SCRATCH_TOP_G2H_POOL_PAGES_OFFSET
SCRATCH_TOP_G2H_QUEUE_SIZE_OFFSET
SCRATCH_TOP_GPA
We assume 36-bit IPAs for now, since every amd64 processor supports at least 36 bits. Almost all of them support at least 40 bits, so we could consider bumping this in the future if we were ever memory-constrained.
SCRATCH_TOP_GUEST_LOG_LEVEL_OFFSET
SCRATCH_TOP_GVA
We have this the top of the page below the top of memory in order to make working with start/end ptrs in a few places more convenient (not needing to worry about overflow)
SCRATCH_TOP_H2G_BUFFER_SIZE_OFFSET
SCRATCH_TOP_H2G_POOL_PAGES_OFFSET
SCRATCH_TOP_H2G_QUEUE_SIZE_OFFSET
SCRATCH_TOP_HEAP_EXECUTABLE_OFFSET
SCRATCH_TOP_LIBC_RNG_SEED_OFFSET
SCRATCH_TOP_RESERVED_PAGES
Pages reserved for the exception stack and scratch-top metadata.
SCRATCH_TOP_SIZE_OFFSET
SCRATCH_TOP_SNAPSHOT_GENERATION_OFFSET
SCRATCH_TOP_SNAPSHOT_PT_GPA_BASE_OFFSET
SCRATCH_TOP_TRANSPORT_ARENA_GPA_OFFSET
SCRATCH_TRANSPORT_GAP_PAGES
Unmapped pages between the transport arena and the reserved top pages. On amd64 an exception stack overrun faults in them before it reaches the arena. aarch64 exception vectors lower SP before their first store, so nested faults there can step past them.
SNAPSHOT_PT_GVA_MAX
SNAPSHOT_PT_GVA_MIN
VIRTQ_BUFFER_GVA_END
VIRTQ_BUFFER_GVA_START

Functions§

io_page
min_scratch_size
Compute fixed scratch overhead for a sandbox, saturating at usize::MAX.
scratch_base_gpa
scratch_base_gva
scratch_reserved_top_gpa
Start of the reserved pages at the top of scratch. The transport arena sits SCRATCH_TRANSPORT_GAP_PAGES below it. A guest’s page allocator stops at the arena GPA the host publishes.
scratch_reserved_top_gva
scratch_reserved_top_gpa in the scratch mapping.
scratch_transport_end_gpa
Exclusive end of the transport arena: the reserved top pages, less the guard pages between them.
scratch_transport_end_gva
scratch_transport_end_gpa in the scratch mapping.