Skip to main content

min_scratch_size

Function min_scratch_size 

Source
pub fn min_scratch_size(
    input_data_size: usize,
    output_data_size: usize,
) -> usize
Expand description

Compute the minimum scratch region size needed for a sandbox. On amd64, this is:

  • Two pages for the TSS and IDT
  • (up to) 4 pages for the PTEs for mapping that (including CoW’ing the root PT)
  • A page for the smallest possible non-exception stack
  • (up to) 3 pages for mapping that
  • Two pages for the exception stack and metadata
  • A page-aligned amount of memory for I/O buffers (for now)