phys_to_virt(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

okay so bestie, we're looking at phys_to_virt(9) from the Kernel API Manual, and it's literally the function that maps a physical address to a virtual one. iconic behavior, no cap ✨


πŸŽ€ SYNOPSIS πŸŽ€

void * phys_to_virt (phys_addr_t address );

like that's the whole vibe check 🫢


🌸 ARGUMENTS 🌸

  • address β€” address to remap πŸ’… that's the one and only argument, bestie.

πŸ¦‹ DESCRIPTION πŸ¦‹

The returned virtual address is a current CPU mapping for the memory address given. it's only valid to use this function on addresses that have a kernel mapping, periodt.

⚠️ so like… only valid on addresses that have a kernel mapping. don't come for me if you ignore that, i warned you 😭

This function does not handle bus mappings for DMA transfers. nope, not its job, not its lane 🚫

In almost all conceivable cases a device driver should not be using this function. like… fr fr, almost all conceivable cases, bestie. it's giving "not for your driver, actually" πŸ’€


🌈 SEE ALSO 🌈

go read those too, iykyk πŸ‘‘


mwah πŸ’‹ source/version: ./arch/x86/include/asm, dated October 2026. slay and read your manpages, bestie πŸŽ€πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from