KVM: arm64: Introduce dynamic hyp_vmemmap
The hyp_vmemmap is one of pKVM's largest data structures with the host
and hyp page-tables. To reduce its memory footprint, let's introduce a
new dynamically allocated per-page data-structure. This data structure
holds struct dyn_hyp_page elements, indexed by pfn, into a dynamically
allocated rbtree. It uses a get/put API which may allocate/free nodes
from the hyp allocator -- callers must be able to handle allocation
failures.
Under the hood, the nodes are allocated in groups called 'banks' to
reduce the memory overhead of the metadata (size of rb_node, allocator
metadata, ...) and to improve range-based performance (when e.g. working
with huge-pages).
With this new infrastructure in place, introduce a first user by moving
hyp_page::host_share_guest_count.
Signed-off-by: Quentin Perret <qperret@google.com>
5 files changed