kvm_pgtable_hyp_destroy(9)
π kvm_pgtable_hyp_destroy β the kernel API manual, bestie edition β¨
Okay so real quick β this is a page from the Kernel API Manual, and it's about kvm_pgtable_hyp_destroy. Buckle up, it's short but it matters. π«Ά
πΈ NAME πΈ
kvm_pgtable_hyp_destroy β tear down a hypervisor stage-1 page-table that nobody's using anymore. Like, send it to the shadow realm. Bye bestie πβ¨
π¦ SYNOPSIS π¦
void kvm_pgtable_hyp_destroy(struct kvm_pgtable *pgt);
π ARGUMENTS π
pgtβ the page-table struct, and listen: this has to be one that was already set up bykvm_pgtable_hyp_init. Not just any struct you found lying around, okay? π
π DESCRIPTION π
So here's the vibe check: this function assumes the page-table is already unreachable by any hardware walkers before it gets freed. Like, nobody's out there walking it, no hardware is peeking, it's fully ghosted. π»
Because of that assumption, no TLB invalidation is performed. None. Zero. Not a single flush. So make absolutely sure that assumption is true before you call this β this is a "trust me bro" situation and the kernel is trusting you. π
π SEE ALSO π
Kernel file: ./arch/arm64/include/asm/kvm_pgtable.h
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_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)
And that's the whole page, bestie π mwah π β this lil' gem lives in ./arch/arm64/include/asm, it's part of the Kernel API Manual, and it's stamped October 2026. Go forth and destroy page-tables responsibly π§ββοΈβ
π¦ 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