create_hyp_mappings(9)
π
create_hyp_mappings(9) β the <pink>Kernel API Manual</pink> glow-up π
okay bestie, so this one's a <cyan>9</cyan>-section manpage from the Kernel API Manual, and it is literally about making Hyp mode see the exact same memory your kernel already sees. no cap, it's giving "copy my homework but change it just enough" energy π
β¨ NAME β¨
create_hyp_mappings β duplicate a kernel virtual address range in Hyp mode π¦
πΈ SYNOPSIS πΈ
int create_hyp_mappings (void *from , void *to , enum kvm_pgtable_prot
prot );
like, that's the whole signature, keep the spacing, she's iconic π
π ARGUMENTS π
fromβ the virtual kernel start address of the range. like where the vibe begins β¨toβ the virtual kernel end address of the range, and it's exclusive bestie, so don't come for me when the last byte isn't included πprotβ the protection applied to this range. yes, she has boundaries π
π«Ά DESCRIPTION π«Ά
so the whole point: the same virtual address as the kernel virtual address is also used in the Hyp-mode mapping β modulo HYP_PAGE_OFFSET β and it points at the same underlying physical pages. no copies, no dupes, literally the same pages, just a second mapping living its best main-character life in Hyp mode ππ₯
lowkey obsessed with how simple that is. same address vibe, shifted by HYP_PAGE_OFFSET, same physical pages underneath. periodt.
π SEE ALSO π
kernel file ./arch/arm64/kvm/mmu.c plus the whole friend group:
kvm_arch_flush_remote_tlbs(9)__unmap_stage2_range(9)stage2_flush_vm(9)free_hyp_pgds(9)hyp_alloc_private_va_range(9)create_hyp_io_mappings(9)create_hyp_exec_mappings(9)kvm_init_stage2_mmu(9)stage2_unmap_vm(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)
go read them, iykyk π
kisses, this page came straight out of ./arch/arm64/kvm, dated <hotpink>October 2026</hotpink>, 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