Go to file
LiuJun5817 b1d261a295 fix: fix an error in requires of dealloc 2025-10-29 13:49:11 +08:00
benches perf: update v3_impl to improve performance and add some tests 2025-10-16 21:23:10 +08:00
docs docs: change the fixture of BitAlloc_struct.png 2025-09-26 19:48:50 +08:00
node_modules feat(bitalloccascade16): implemented the alloc function for the 16-level tree structure 2025-09-04 14:17:31 +08:00
src fix: fix an error in requires of dealloc 2025-10-29 13:49:11 +08:00
.gitignore init FrameAllocatorState and some spec of alloc 2025-05-12 08:52:38 +08:00
Cargo.lock style: change the dependency of vstd 2025-10-16 22:12:02 +08:00
Cargo.toml style: change the dependency of vstd 2025-10-16 22:12:02 +08:00
LICENSE Create LICENSE 2025-09-07 15:38:23 +08:00
README.md Update README.md 2025-09-26 20:01:23 +08:00
package-lock.json feat: completed the function of dealloc and change the struct BitAllocCascade16 2025-09-05 19:20:11 +08:00
package.json feat: completed the function of dealloc and change the struct BitAllocCascade16 2025-09-05 19:20:11 +08:00

README.md

Formal Verification of Memory Allocator in Hvisor

Proof Target: bitmap-allocator, which is a Bitmap-based allocator employs a multi-level bitmap structure to achieve efficient management of large-scale memory space.

Introduction

Why Memory Allocation Matters

In a Type-I Hypervisor, the memory allocator is responsible for assigning non-overlapping physical page ranges to different VMs. It collaborates with the page table to achieve strong isolation and verifiable security:

  • Disjointness: At any time, allocated intervals must be non-overlapping.
  • Availability: If there exists a sufficiently large contiguous free region, the allocator must be able to locate and return it.
  • Reclaimability: Once released, an interval must return to the free set.
  • Hierarchy Consistency: The parent-level bitmap must correspond exactly to the views of its child allocators.

The page table enforces access control, while the allocator ensures non-overlapping intervals and resource scheduling. Together, they form the foundation of memory isolation in virtual machines, as shown in the following figure.

BitMap-Allocator Structure

The following figure illustrates the tree-like structure of bitmap-allocator. It's each layer manages an address space 16 times larger than the next layer below it.

Proof Architecture

We divide the verification into three layers:

  • The first layer includes several non-standard library functions that are invoked.
  • The second layer is BitAlloc16, which serves as the leaf-node layer.
  • The third layer is BitAllocCascade16, forming a complete 16-ary tree.