kvm_pgtable_...ate_unlinked(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… kvm_pgtable_stage2_create_unlinked β€” Create an unlinked stage-2 paging structure πŸ’…

okay bestie, welcome to the Kernel API Manual, section 9. This page is literally about kvm_pgtable_stage2_create_unlinked, and the vibe is: you're building a stage-2 page-table tree that is intentionally not hooked into the root pgd yet. main-character energy only. ✨

🌸 NAME 🌸

kvm_pgtable_stage2_create_unlinked β€” Create an unlinked stage-2 paging structure.

✨ SYNOPSIS ✨

kvm_pte_t * kvm_pgtable_stage2_create_unlinked (struct kvm_pgtable *pgt
, u64 phys , s8 level , enum kvm_pgtable_prot prot , void *mc , bool
force_pte );

πŸŽ€ ARGUMENTS πŸŽ€

  • pgt β€” the page-table structure that got initialised by kvm_pgtable_stage2_init*().
  • phys β€” physical address of the memory you're mapping.
  • level β€” the starting level of the stage-2 paging structure you want created.
  • prot β€” permissions and attributes for the mapping.
  • mc β€” cache of pre-allocated and zeroed memory, and that's where page-table pages get allocated from.
  • force_pte β€” force mappings to PAGE_SIZE granularity.

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so this function hands you back an unlinked page-table tree. It is not reachable β€” literally unlinked β€” from the root pgd, so the hardware page-table walker cannot reach it either. No TLB invalidation or CMOs are performed. none. zero. zip. πŸ’…

If device attributes are not explicitly requested in prot, then the mapping will be normal and cacheable. that's the tea. πŸ“

πŸ‘‘ RETURN πŸ‘‘

You get the fully populated stage-2 paging structure β€” still unlinked, bestie β€” or an ERR_PTR(error) if it fails. slay when it works, sad little error pointer when it doesn't. 😭

🌈 SEE ALSO 🌈

Kernel file ./arch/arm64/include/asm/kvm_pgtable.h is the spot, fr fr. Also peep these: 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), 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_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).


made with πŸ’– from source ./arch/arm64/include/asm, dated October 2026, for the manual page kvm_pgtable_...ate_unlinked(9). byeee, go build your unlinked tree 🫢

πŸ“¦ where this page comes from