kvm_pgtable_hyp_unmap(9)
π NAME π
okay so welcome to the kvm_pgtable_hyp_unmap(9) page in the Kernel API Manual, bestie! This one is all about kvm_pgtable_hyp_unmap β it removes a mapping from a hypervisor stage-1 page-table. thatβs the whole assignment, no cap π
π¦ SYNOPSIS π¦
hereβs the signature, and we are copying it exactly because we do not freestyle C signatures in this house:
u64 kvm_pgtable_hyp_unmap (struct kvm_pgtable *pgt , u64 addr , u64 size
);
πΈ ARGUMENTS πΈ
pgtβ the page-table structure initialised bykvm_pgtable_hyp_init. this is your main-character page-table β¨addrβ virtual address from which to remove the mapping. bye mapping, we hardly knew ye πsizeβ size of the mapping. yes, the size. the amount. the whole vibe π
π DESCRIPTION π
so hereβs the tea β: the offset of addr within a page is ignored, size is rounded-up to the next page boundary, and phys is rounded-down to the previous page boundary. periodt.
TLB invalidation is performed for each page-table entry cleared during the unmapping operation, and the reference count for the page-table page containing the cleared entry is decremented β with unreferenced pages being freed. that cleanup is lowkey iconic π§
the unmapping operation will stop early if it encounters either an invalid page-table entry or a valid block mapping which maps beyond the range being unmapped. so if it hits either of those, itβs like βok bestie, Iβm outβ π
π RETURN π
Number of bytes unmapped, which may be 0. yes, zero is valid and itβs giving βnothing was unmapped, but make it fashionβ π
π SEE ALSO π
Kernel file ./arch/arm64/include/asm/kvm_pgtable.h and the whole friend group:
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_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)
β¨ cute sign-off: source/version line is ./arch/arm64/include/asm, date is October 2026, and the page is kvm_pgtable_hyp_unmap(9). go slay those page tables, bestie β mwah ππ«Ά
π¦ 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