Skip to main content

check_user_mapping

Function check_user_mapping 

Source
fn check_user_mapping(vaddr: u64) -> Result<(), &'static str>
Expand description

Checks that vaddr is mapped and USER_ACCESSIBLE at every level of the page hierarchy (PML4 → PDPT → PD → PT).

Returns Ok(()) if all levels have PRESENT | USER_ACCESSIBLE set. Otherwise returns Err(&str) naming the problematic level.

Handles 1 GiB (PDPT) and 2 MiB (PD) huge pages: stop descending once a huge-page entry is found with USER_ACCESSIBLE.