pub struct VmCtx {Show 30 fields
pub futex: AtomicU32,
pub program_counter: AtomicU32,
pub jump_into: AtomicU64,
pub next_native_program_counter: AtomicU64,
pub tmp_reg: AtomicU64,
pub rip: AtomicU64,
pub next_program_counter: AtomicU32,
pub arg: AtomicU32,
pub arg2: AtomicU32,
pub arg3: AtomicU32,
pub _align_dummy: [u64; 4],
pub gas: AtomicI64,
pub regs: [AtomicU64; 13],
pub heap_info: VmCtxHeapInfo,
pub shm_memory_map_offset: AtomicU64,
pub shm_memory_map_count: AtomicU64,
pub shm_code_offset: AtomicU64,
pub shm_code_length: AtomicU64,
pub shm_jump_table_offset: AtomicU64,
pub shm_jump_table_length: AtomicU64,
pub sysreturn_address: AtomicU64,
pub uffd_enabled: AtomicBool,
pub heap_base: UnsafeCell<u32>,
pub heap_initial_threshold: UnsafeCell<u32>,
pub heap_max_size: UnsafeCell<u32>,
pub page_size: UnsafeCell<u32>,
pub counters: CacheAligned<VmCtxCounters>,
pub init: VmInit,
pub message_length: UnsafeCell<u32>,
pub message_buffer: UnsafeCell<[u8; 512]>,
/* private fields */
}Expand description
The virtual machine context.
This is mapped in shared memory and used by the sandbox to keep its state in, as well as by the host to communicate with the sandbox.
Fields§
§futex: AtomicU32The futex used to synchronize the sandbox with the host process.
program_counter: AtomicU32The address of the instruction currently being executed.
jump_into: AtomicU64Address to which to jump to.
next_native_program_counter: AtomicU64The address of the native code to call inside of the VM process, if non-zero.
tmp_reg: AtomicU64§rip: AtomicU64§next_program_counter: AtomicU32The address of the next instruction to be executed.
arg: AtomicU32A multipurpose field:
- the hostcall number that was triggered,
- the sbrk argument,
- the sbrk return value,
arg2: AtomicU32§arg3: AtomicU32§_align_dummy: [u64; 4]§gas: AtomicI64The current gas counter.
regs: [AtomicU64; 13]A dump of all of the registers of the VM.
heap_info: VmCtxHeapInfoThe state of the program’s heap.
shm_memory_map_offset: AtomicU64Offset in shared memory to this sandbox’s memory map.
shm_memory_map_count: AtomicU64Number of maps to map.
shm_code_offset: AtomicU64Offset in shared memory to this sandbox’s code.
shm_code_length: AtomicU64Length this sandbox’s code.
shm_jump_table_offset: AtomicU64Offset in shared memory to this sandbox’s jump table.
shm_jump_table_length: AtomicU64Length of sandbox’s jump table, in bytes.
sysreturn_address: AtomicU64Address of the sysreturn routine.
uffd_enabled: AtomicBoolWhether userfaultfd-based memory management is enabled.
heap_base: UnsafeCell<u32>Address to the base of the heap.
heap_initial_threshold: UnsafeCell<u32>The initial heap growth threshold.
heap_max_size: UnsafeCell<u32>The maximum heap size.
page_size: UnsafeCell<u32>The page size.
counters: CacheAligned<VmCtxCounters>Performance counters. Only for debugging.
init: VmInitOne-time args used during initialization.
message_length: UnsafeCell<u32>Length of the message in the message buffer.
message_buffer: UnsafeCell<[u8; 512]>A buffer used to marshal error messages.