Skip to content

Commit 1fac3cf

Browse files
Quentin PerretMarc Zyngier
authored andcommitted
KVM: arm64: Provide {get,put}_page() stubs for early hyp allocator
In nVHE protected mode, the EL2 code uses a temporary allocator during boot while re-creating its stage-1 page-table. Unfortunately, the hyp_vmmemap is not ready to use at this stage, so refcounting pages is not possible. That is not currently a problem because hyp stage-1 mappings are never removed, which implies refcounting of page-table pages is unnecessary. In preparation for allowing hypervisor stage-1 mappings to be removed, provide stub implementations for {get,put}_page() in the early allocator. Acked-by: Will Deacon <[email protected]> Signed-off-by: Quentin Perret <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 2d761db commit 1fac3cf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

arch/arm64/kvm/hyp/nvhe/early_alloc.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ void *hyp_early_alloc_page(void *arg)
4343
return hyp_early_alloc_contig(1);
4444
}
4545

46+
static void hyp_early_alloc_get_page(void *addr) { }
47+
static void hyp_early_alloc_put_page(void *addr) { }
48+
4649
void hyp_early_alloc_init(void *virt, unsigned long size)
4750
{
4851
base = cur = (unsigned long)virt;
@@ -51,4 +54,6 @@ void hyp_early_alloc_init(void *virt, unsigned long size)
5154
hyp_early_alloc_mm_ops.zalloc_page = hyp_early_alloc_page;
5255
hyp_early_alloc_mm_ops.phys_to_virt = hyp_phys_to_virt;
5356
hyp_early_alloc_mm_ops.virt_to_phys = hyp_virt_to_phys;
57+
hyp_early_alloc_mm_ops.get_page = hyp_early_alloc_get_page;
58+
hyp_early_alloc_mm_ops.put_page = hyp_early_alloc_put_page;
5459
}

0 commit comments

Comments
 (0)