STRUCT KVM_PGTABLE(9)
π struct kvm_pgtable β KVM page-table, bestie edition π
okay so this is the kvm_pgtable man page (from the Kernel API Manual, section 9) and honestly? it's kind of the main character of arm64 KVM memory management. it's the literal page-table struct, no cap. let's get into it π«Ά
β¨ NAME β¨
struct kvm_pgtable β the KVM page-table π
πΈ SYNOPSIS πΈ
struct kvm_pgtable {
union {
struct rb_root_cached pkvm_mappings;
struct {
u32 ia_bits;
s8 start_level;
kvm_pteref_t pgd;
struct kvm_pgtable_mm_ops *mm_ops;
enum kvm_pgtable_stage2_flags flags;
kvm_pgtable_force_pte_cb_t force_pte_cb;
};
};
struct kvm_s2_mmu *mmu;
};
like, look at that nesting. the way that anonymous union and anonymous struct are just vibing inside each other? iconic. π
π¦ Members π¦
so there's this one union that can hold either pkvm_mappings (a struct rb_root_cached) or a whole lil anonymous struct of page-table config β pick your fighter, but it's an anonymous union so it's literally unnamed:
{unnamed_union}β anonymous, bestie. it's just there. π{unnamed_struct}β also anonymous. no name, all vibe.ia_bitsβ the maximum input address size, in bits β¨start_levelβ the level where the page-table walk kicks off (where the journey begins, fr)pgdβ pointer to the very first top-level entry of the page-table πmm_opsβ the memory management callbacks. so like, all the mm stuff goes through these π«Άflagsβ the stage-2 page-table flags π©force_pte_cbβ a function that returnstrueif page level mappings MUST be used instead of block mappings. it's giving "no block mappings allowed" energy πmmuβ the stage-2 KVM MMU struct. unused for stage-1 page-tables, so don't come for it if it's not doing anything in stage-1, okay? π
π SEE ALSO π
okay bestie, get comfy, this list is LONG and every single one of these is a real one. the kernel file is ./arch/arm64/include/asm/kvm_pgtable.h, and then we got:
struct kvm_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)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_stage2_split(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)
like I said. long. but every single one matters, so go read them all, iykyk πβ¨
tiny heads-up bestie: this whole page lives at ./arch/arm64/include/asm β that's the source path and it's important, don't lose it π
and that's the page!! π this one came from the Kernel API Manual, section 9, dated October 2026, and it's struct kvm_pgtable(9) β mwah, slay, periodt ππ¦πΈ
π¦ 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