diff options
author | Fuad Tabba <tabba@google.com> | 2025-09-09 08:24:32 +0100 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2025-09-15 10:46:55 +0100 |
commit | 3c45b67625357ac680ee2508493b697cdcd78128 (patch) | |
tree | 96dd775b61aca00b42d420e619137776e646b20f /rust/kernel/alloc/allocator.rs | |
parent | 070362648f5f546018747a9a1857c1597594934e (diff) |
KVM: arm64: Decouple hyp VM creation state from its handle
Currently, the presence of a pKVM handle (pkvm.handle != 0) is used to
determine if the corresponding hypervisor (EL2) VM has been created and
initialized. This couples the handle's lifecycle with the VM's creation
state.
This coupling will become problematic with upcoming changes that will
allocate the pKVM handle earlier in the VM's life, before the VM is
instantiated at the hypervisor.
To prepare for this and make the state tracking explicit, decouple the
two concepts. Introduce a new boolean flag, 'pkvm.is_created', to track
whether the hypervisor-side VM has been created and initialized.
A new helper, pkvm_hyp_vm_is_created(), is added to check this flag. All
call sites that previously checked for the handle's existence are
converted to use the new, explicit check. The 'is_created' flag is set
to true upon successful creation in the hypervisor (EL2) and cleared
upon destruction.
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.rs')
0 files changed, 0 insertions, 0 deletions