Memory Pools

For each partition, the hypervisor maintains a memory pool of RAM system physical address (SPA) pages. This pool is managed like a bank account. The number of pages in the pool is referred to as the balance. A partition can call the HvDepositMemory hypercall function to deposit pages into the pool or the HvWithdrawMemory hypercall function to withdraw pages from the pool. Also, a partition can call the HvGetMemoryBalance hypercall function to retrieve the number of pages in the pool.

When a partition makes a hypercall that requires memory, the hypervisor draws the required memory from the pool. If the balance in the pool is insufficient, the call fails. If such a hypercall is made by one guest on behalf of another guest (in another partition), the hypervisor draws the required memory from the pool of the latter partition. The phrase "on behalf of" refers to any hypervisor call with a HV_PARTITION_ID parameter. Examples of such calls are calls to the HvCreateVp and HvMapGpaPages functions.

Pages within a partition's memory pool are managed by the hypervisor. These pages cannot be accessed through any partition's guest physical address (GPA) space. That is, in all partitions' GPA spaces, the pages must be inaccessible (in other words, mapped such that no read, write, or execute access is allowed). In general, the only partition that can deposit into or withdraw from a partition is that partition's parent.

When a partition is created, the memory pool is initially empty. A partition can call the HvDepositMemory hypercall function to deposit memory.

The following invariants are maintained:

  • All memory pool pages are RAM SPA pages that were previously mapped into the GPA space of the parent partition.

  • All pages in a partition's memory pool must have been explicitly deposited into that partition's pool; that is, memory does not migrate between memory pools of different partitions.

  • Pages in a partition's memory pool cannot be accessed by any guest; that is, these pages are not mapped into any partition's GPA space with read, write, or execute privileges.

 

 

Send comments about this topic to Microsoft

Build date: 11/16/2013

Show:
© 2014 Microsoft. All rights reserved.