kvm_pgtable_stage2_split(9)
π kvm_pgtable_stage2_split(9) β a Kernel API Manual moment π
okay bestie, welcome to the Kernel API Manual page for kvm_pgtable_stage2_split. this one is lowkey iconic: it takes big huge-page ranges and tries to split them into little leaf PTEs that point at PAGE_SIZE guest pages. no cap, itβs giving page-table surgery π
β¨
πΈ NAME πΈ
kvm_pgtable_stage2_split β Split a range of huge pages into leaf PTEs pointing to PAGE_SIZE guest pages.
β¨ SYNOPSIS β¨
int kvm_pgtable_stage2_split (struct kvm_pgtable *pgt , u64 addr , u64 size , struct kvm_mmu_memory_cache *mc );
π¦ ARGUMENTS π¦
pgtβ Page-table structure initialised bykvm_pgtable_stage2_init.addrβ Intermediate physical address from which to split.sizeβ Size of the range.mcβ Cache of pre-allocated and zeroed memory from which to allocate page-table pages.
π DESCRIPTION π
The function tries to split any level 1 or 2 entry that overlaps with the input range (given by addr and size).
like, itβs literally looking at the range you handed it and going βokay bestie, which of these bigger entries can we break down?β π«Ά
π₯ RETURN π₯
0 on success, negative error code on failure. Note that kvm_pgtable_stage2_split is best effort: it tries to break as many blocks in the input range as allowed by mc_capacity.
so yeah, itβs not out here promising perfection β itβs best effort, periodt. π
π SEE ALSO π
- Kernel file
./arch/arm64/include/asm/kvm_pgtable.hstructkvm_pgtable_mm_ops(9) enum kvm_pgtable_stage2_flags(9)enum kvm_pgtable_prot(9)enum kvm_pgtable_walk_flags(9)struct kvm_pgtable_walker(9)struct kvm_pgtable(9)kvm_pgtable_hyp_init(9)kvm_pgtable_hyp_destroy(9)kvm_pgtable_hyp_map(9)kvm_pgtable_hyp_unmap(9)kvm_get_vtcr(9)kvm_pgtable_stage2_pgd_size(9)__kvm_pgtable_stage2_init(9)kvm_pgtable_stage2_destroy(9)kvm_pgtable_stage2_destroy_range(9)kvm_pgtable_stage2_destroy_pgd(9)kvm_pgtable_stage2_free_unlinked(9)kvm_pgtable_stage2_create_unlinked(9)kvm_pgtable_stage2_map(9)kvm_pgtable_stage2_annotate(9)kvm_pgtable_stage2_unmap(9)kvm_pgtable_stage2_wrprotect(9)kvm_pgtable_stage2_mkyoung(9)kvm_pgtable_stage2_test_clear_young(9)kvm_pgtable_stage2_relax_perms(9)kvm_pgtable_walk(9)kvm_pgtable_get_leaf(9)kvm_pgtable_stage2_pte_prot(9)kvm_pgtable_hyp_pte_prot(9)kvm_tlb_flush_vmid_range(9)
bye bestie π this page is from ./arch/arm64/include/asm, dated October 2026, and the footer name is still kvm_pgtable_stage2_split(9). slay πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms