kvm_pgtable_stage2_unmap(9)
π kvm_pgtable_stage2_unmap π
okay bestie, welcome to the Kernel API Manual β¨ this page is literally kvm_pgtable_stage2_unmap(9), and we are about to remove a mapping from a guest stage-2 page-table. no cap, itβs giving cleanup era π§Ήπ
πΈ NAME πΈ
kvm_pgtable_stage2_unmap β Remove a mapping from a guest stage-2 page-table. periodt π
β¨ SYNOPSIS β¨
int kvm_pgtable_stage2_unmap (struct kvm_pgtable *pgt , u64 addr , u64 size );
π ARGUMENTS π
pgtβ the page-table structure, already initialised bykvm_pgtable_stage2_init*(). yes bestie, the star is part of it, donβt come for me π«Άaddrβ the intermediate physical address from which to remove the mapping πsizeβ the size of the mapping.
π¦ DESCRIPTION π¦
okay so hereβs the tea: the offset of addr within a page is ignored, and size is rounded-up to the next page boundary. not me being dramatic, thatβs literally the whole vibe.
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. so yeah, cleanup girlies, unreferenced pages get freed π§Ήβ¨
also: unmapping a cacheable page will ensure that it is clean to the PoC if FWB is not supported by the CPU. keep that in mind, bestie π
π RETURN π
0on success π- negative error code on failure π
π SEE ALSO π
first up, 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_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_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)
xoxo bestie, this page is sourced from ./arch/arm64/include/asm, dated October 2026, and the man page is kvm_pgtable_stage2_unmap(9) πβ¨
π¦ 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