ttm_bo_kmap_try_from_panic(9)
β¨ ttm_bo_kmap_try_from_panic β¨
okay bestie, welcome to the Kernel API Manual entry for ttm_bo_kmap_try_from_panic(9) β yes the name is a mouthful, no I will not be shortening it, we respect her full government name π
π NAME π
ttm_bo_kmap_try_from_panic β and that's it, that's the whole name section. The original page gives us literally nothing else here, no cap. Iconic minimalism, honestly. π¦
β SYNOPSIS β
void * ttm_bo_kmap_try_from_panic (struct ttm_buffer_object *bo ,
unsigned long page );
πΈ ARGUMENTS πΈ
boβ the buffer object, aka the whole point of this function, the main character π«Άpageβ the page that's getting mapped, the lil guy we're here for
π₯ DESCRIPTION π₯
So what does she actually do? She sets up a kernel virtual mapping using kmap_local_page_try_from_panic. That's the vibe. β¨
β οΈ ok so listen, this one comes with a big rule: this should only be called from the panic handler, and only if you make sure the bo is the one being displayed β so it's properly allocated and protected. Like, that's not a suggestion, that's the whole condition for using this thing. Don't be out here calling it from random places, bestie, I'm begging π
She returns the vaddr, which you can use to write to the bo, and which you should pass to kunmap_local when you're done with this page. Or she returns NULL if the bo is in iomem. That's the whole deal π
π SEE ALSO π
Kernel file ./drivers/gpu/drm/ttm/ttm_bo_util.c β go read it, it's giving lore π§
And the whole friend group:
ttm_move_memcpy(9)ttm_bo_move_memcpy(9)ttm_buffer_object_transfer(9)ttm_io_prot(9)ttm_bo_kmap(9)ttm_bo_kunmap(9)ttm_bo_vmap(9)ttm_bo_vunmap(9)ttm_bo_move_accel_cleanup(9)ttm_bo_move_sync_cleanup(9)ttm_bo_pipeline_gutting(9)ttm_lru_walk_for_evict(9)ttm_bo_lru_cursor_fini(9)ttm_bo_lru_cursor_init(9)ttm_bo_lru_cursor_next(9)ttm_bo_lru_cursor_first(9)ttm_bo_shrink(9)ttm_bo_shrink_suitable(9)ttm_bo_shrink_avoid_wait(9)
and that's the page!! πβ¨ mwah, love u, go read ur kernel source. this lil masterpiece lives at ./drivers/gpu/drm/ttm and it's stamped October 2026 β yes, girl, mark the calendar ππ
π¦ 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