islet-project / islet

An on-device confidential computing platform
Apache License 2.0
93 stars 17 forks source link

vmsa: introduce new_in() with an allocator as a parameter #348

Closed bokdeuk-jeong closed 3 months ago

bokdeuk-jeong commented 3 months ago

The ulimate goal is to eliminate redundant functions for the realm s2 table management which are scattered across the board in rtt.rs, stage2_translation.rs, stage2_tte.rs, page.rs and lib/vmsa. Prior to that, this PR does followings.

  1. Create a page table with an allocator that the function caller provides.
  2. Return as a reference and reduce unsafe usages.
  3. Simplify mutiple look-alike functions into one.