STRUCT KVM_PGTABLE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 returns true if 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:

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