remap_io_sg(9)
π remap_io_sg(9) π
okay bestie, this is the Kernel API Manual page for remap_io_sg(9), and it is lowkey iconic. It's giving remap an IO mapping to userspace energy, with six arguments and one very real safety note. Let's go, no cap. π«Άβ¨
πΈ NAME πΈ
remap_io_sg β remap an IO mapping to userspace. That's the whole main character moment: IO mapping gets remapped to userspace. Slay. π
π¦ SYNOPSIS π¦
int remap_io_sg (struct vm_area_struct *vma , unsigned long addr ,
unsigned long size , struct scatterlist *sgl , unsigned long offset ,
resource_size_t iobase );
π ARGUMENTS π
Six args, bestie. Every single one is important, so no skipping the vibe check:
vmaβ user vma to map to. That's the user vma you're mapping to, periodt. πaddrβ target user address to start at. The target user address where the map starts. π―sizeβ size of map area. Literally the size of the map area. πsglβ Start sg entry: the sg entry where the journey starts. π§Ίoffsetβ offset from the start of the page. Just the offset from the start of the page, bestie. πiobaseβ Use stored dma address offset by this address or pfn if-1. That's the rule, fr fr. π§
π¨ NOTE π¨
this is only safe if the mm semaphore is held when called. Like, only safe, bestie. Hold the mm semaphore when you call this β the note is literally the safety rule. π No cap.
π SEE ALSO π
- Kernel file
./drivers/gpu/drm/i915/i915_mm.c remap_io_mapping(9)
iykyk, go peek at those if you need the sister pages. π¦
made with π from ./drivers/gpu/drm/i915, dated October 2026 β cute sign-off, bye bestie! ππ·
π¦ 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