Skip to main content

second_level_pointer

Function second_level_pointer 

Source
pub fn second_level_pointer(
    world_id: u64,
    caps: &HwCaps,
) -> Result<u64, VmError>
Expand description

Returns the second-level translation pointer (EPTP) of a world.

The value is the pointer the control block uses to walk the guest physical address space; it is the world’s real translation table, not a mirror. It stays valid as long as the world exists and its guest memory has not been destroyed (the tables are freed by destroy), so the caller must not cache it beyond the world’s lifetime. The registry lock is taken briefly for the lookup and never across guest execution.

Returns VmError::Unknown when the world does not exist, and VmError::Map with MapError::NotMapped when the world has no guest memory yet.