Function register_regions

Source
pub unsafe fn register_regions(
    regions: &[Range<usize>],
    uffds: &[Userfaultfd],
) -> Result<()>
Expand description

Register all the regions to all the userfaultfd

§Arguments

  • regions - the list of address range of regions.
  • uffds - the reference to the list of Userfaultfd for all the processes which may touch the address_range to be registered.

§Safety

Each address range in regions must be from guest memory.

The uffds must cover all the processes which may touch the address_range. otherwise some pages are zeroed by kernel on the unregistered process instead of swapping in from the swap file.