summaryrefslogtreecommitdiff
path: root/rust/kernel/alloc/allocator.rs
diff options
context:
space:
mode:
authorFuad Tabba <tabba@google.com>2025-09-09 08:24:33 +0100
committerMarc Zyngier <maz@kernel.org>2025-09-15 10:46:55 +0100
commit1abc1ad52989fcc45a0de68bc49656d9fd0c2d74 (patch)
treee451dcf152680e8b24d22531e4bb244e659ce24f /rust/kernel/alloc/allocator.rs
parent3c45b67625357ac680ee2508493b697cdcd78128 (diff)
KVM: arm64: Separate allocation and insertion of pKVM VM table entries
The current insert_vm_table_entry() function performs two actions at once: it finds a free slot in the pKVM VM table and populates it with the pkvm_hyp_vm pointer. Refactor this function as a preparatory step for future work that will require reserving a VM slot and its corresponding handle earlier in the VM lifecycle, before the pkvm_hyp_vm structure is initialized and ready to be inserted. Split the function into a two-phase process: - A new allocate_vm_table_entry() function finds an empty slot, marks it as reserved with a RESERVED_ENTRY placeholder, and returns a handle derived from the slot's index. - The insert_vm_table_entry() function is repurposed to take the handle, validate that the corresponding slot is in the reserved state, and then populate it with the pkvm_hyp_vm pointer. 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