generic_access_phys(9)
π generic_access_phys β kernel API manual, bestie edition β¨
okay so this is a page from the Kernel API Manual, and honestly? it's a little niche but it's lowkey iconic. it's all about generic_access_phys π
β¨ NAME β¨
generic_access_phys β the generic implementation for iomem mmap access π«Ά
πΈ SYNOPSIS πΈ
int generic_access_phys (struct vm_area_struct *vma , unsigned long addr
, void *buf , int len , int write );
that's the whole signature, no cap π
π¦ ARGUMENTS π¦
vmaβ thevmayou're accessing, like the actual one, not a vibe β¨addrβ a userspace address. and hear me say this: NOT a relative offset withinvma. do not come for me with an offset, i will know πbufβ the buffer where you read from / write to πlenβ how long the transfer is, in case you were wondering πwriteβ set this toFOLL_WRITEwhen you're writing; any other case means you're reading π
π₯ DESCRIPTION π₯
So the way that this works is: it's a generic implementation for vm_operations_struct.access for an iomem mapping. periodt.
This callback gets used by access_process_vm when the vma is not page based. iykyk π
π SEE ALSO π
okay this list is LONG but we do not skip, we do not summarise, we list every single one because that's the assignment π
Kernel file ./mm/memory.c β and then, in order:
free_pgd_range(9)free_pgtables(9)__vm_normal_page(9)vm_normal_page(9)vm_normal_folio(9)vm_normal_page_pmd(9)vm_normal_folio_pmd(9)vm_normal_page_pud(9)restore_exclusive_pte(9)cond_install_uffd_wp_ptes(9)zap_vma_for_reaping(9)unmap_vmas(9)zap_vma_range_batched(9)zap_vma_range(9)zap_special_vma_range(9)vm_insert_pages(9)vm_insert_page(9)vm_map_pages(9)vm_map_pages_zero(9)vmf_insert_pfn_prot(9)vmf_insert_pfn(9)remap_pfn_range(9)vm_iomap_memory(9)__vmf_anon_prepare(9)finish_mkwrite_fault(9)unmap_mapping_folio(9)unmap_mapping_pages(9)unmap_mapping_range(9)set_pte_range(9)finish_fault(9)mm_account_fault(9)follow_pfnmap_start(9)follow_pfnmap_end(9)access_remote_vm(9)copy_remote_vm_str(9)folio_zero_user(9)
like, thirty-six of them?? she ate and left no crumbs ππ₯
ok that's the whole page bestie, no gatekeeping, nothing skipped π
and finally, the cute little sign-off: this beauty lives in the ./mm source, the manual is the Kernel API Manual, and it's dated October 2026 β go forth and access your iomem safely, 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