Skip to main content

reserve_guest_va_range

Function reserve_guest_va_range 

Source
pub fn reserve_guest_va_range() -> Result<(), Error>
Expand description

One-time process-wide reservation of the [guest_va_base(), guest_va_base() + GUEST_VA_SIZE) range. Done on host startup so later mmaps of guest-visible regions (snapshot, scratch, kernel shadow) can land at known fixed VAs via MAP_FIXED inside this reservation.

We use MAP_FIXED_NOREPLACE to claim the configured base atomically; failure means something is squatting on the range, which is almost certainly a misconfiguration — error loudly.