stage2_unmap_vm(9)
π stage2_unmap_vm(9) β like, the Kernel API Manual page you actually wanna read π
Okay bestie, so this is a page straight out of the Kernel API Manual (section 9, iykyk) and it's about one little function that does one big job. Let's get into it β¨
πΈ NAME πΈ
stage2_unmap_vm β unmaps Stage-2 RAM mappings. That's it, that's the whole vibe π«
π¦ SYNOPSIS π¦
void stage2_unmap_vm (struct kvm *kvm );
No cap, that's the entire signature. Void return, one argument, zero drama π«Ά
π ARGUMENTS π
kvmβ thestruct kvmpointer. Yes, literally just "the struct kvm pointer". That's the whole description, bestie, we're not gonna overthink it π
π DESCRIPTION π
So here's what happens, and honestly it's giving housekeeping main character energy π
It goes through the memregions and unmaps any regular RAM backing memory that's already mapped to the VM. That's the whole thing. It walks the memregions, finds the regular RAM backing memory that's already mapped to the VM, and unmaps it. Periodt π
β SEE ALSO β
Omg the friend group π«Ά all of these are also hanging out in the kernel file ./arch/arm64/kvm/mmu.c:
kvm_arch_flush_remote_tlbs(9)__unmap_stage2_range(9)stage2_flush_vm(9)free_hyp_pgds(9)create_hyp_mappings(9)hyp_alloc_private_va_range(9)create_hyp_io_mappings(9)create_hyp_exec_mappings(9)kvm_init_stage2_mmu(9)kvm_phys_addr_ioremap(9)kvm_stage2_wp_range(9)kvm_mmu_wp_memory_region(9)kvm_mmu_split_memory_region(9)kvm_handle_guest_abort(9)
No gatekeeping here, go read them all πβ¨
π Cute lil sign-off: this page lives in ./arch/arm64/kvm and it's dated October 2026. Bookmark it, screenshot it, send it to the group chat π
ily, go unmap some Stage-2 RAM ππ§β¨
π¦ 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