kvm_pgtable_stage2_unmap(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 by kvm_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 🌈

  • 0 on success πŸŽ‰
  • negative error code on failure 😭

πŸ’œ SEE ALSO πŸ’œ

first up, kernel file: ./arch/arm64/include/asm/kvm_pgtable.h 🫢


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