summaryrefslogtreecommitdiff
path: root/rust/kernel/alloc/allocator_test.rs
diff options
context:
space:
mode:
authorFuad Tabba <tabba@google.com>2025-09-09 08:24:35 +0100
committerMarc Zyngier <maz@kernel.org>2025-09-15 10:46:55 +0100
commit256b4668cd890b741c54f83dbbef76ba847c23be (patch)
tree2fe7c8f183c34069ac4b1cf9e0005d61c1c3b3e6 /rust/kernel/alloc/allocator_test.rs
parent814fd6beacf3c105ab8c8796be07d740952899fe (diff)
KVM: arm64: Introduce separate hypercalls for pKVM VM reservation and initialization
The existing __pkvm_init_vm hypercall performs both the reservation of a VM table entry and the initialization of the hypervisor VM state in a single operation. This design prevents the host from obtaining a VM handle from the hypervisor until all preparation for the creation and the initialization of the VM is done, which is on the first vCPU run operation. To support more flexible VM lifecycle management, the host needs the ability to reserve a handle early, before the first vCPU run. Refactor the hypercall interface to enable this, splitting the single hypercall into a two-stage process: - __pkvm_reserve_vm: A new hypercall that allocates a slot in the hypervisor's vm_table, marks it as reserved, and returns a unique handle to the host. - __pkvm_unreserve_vm: A corresponding cleanup hypercall to safely release the reservation if the host fails to proceed with full initialization. - __pkvm_init_vm: The existing hypercall is modified to no longer allocate a slot. It now expects a pre-reserved handle and commits the donated VM memory to that slot. For now, the host-side code in __pkvm_create_hyp_vm calls the new reserve and init hypercalls back-to-back to maintain existing behavior. This paves the way for subsequent patches to separate the reservation and initialization steps in the VM's lifecycle. Signed-off-by: Fuad Tabba <tabba@google.com> Tested-by: Mark Brown <broonie@kernel.org> Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'rust/kernel/alloc/allocator_test.rs')
0 files changed, 0 insertions, 0 deletions