ocxl_context_attach(9)
π ocxl_context_attach β bestie edition
okay so this page is from the Kernel API Manual, and it's all about ocxl_context_attach(9). Sit down, grab a lil snack π, because we're granting an MM access to an OpenCAPI context and it's honestly kind of a whole thing.
β¨ NAME β¨
ocxl_context_attach β grant access to an MM to an OpenCAPI context π«Ά
πΈ SYNOPSIS πΈ
int ocxl_context_attach (struct ocxl_context *ctx , u64 amr , struct
mm_struct *mm );
that's the whole signature, no cap. three args, one int back. slay.
π ARGUMENTS π
ctxβ the OpenCAPI context you're attaching to. like, the main character of this operation πamrβ the value of the AMR register, which restricts access. it's giving "boundaries, but make it hardware" π₯mmβ the mm you're attaching to the context. yes, thatmm_struct, the one you already know and love π
π¦ DESCRIPTION π¦
so here's the tea: this function returns 0 on success, and a negative value on failure.
that's it. that's the vibe check. no extra lore, no secret side quests β success is 0, failure is negative, periodt β¨
π SEE ALSO π
okay this is the friend group, and they're all iconic. kernel file ./include/misc/ocxl.h is the home base π β go say hi:
ocxl_function_open(9)ocxl_function_afu_list(9)ocxl_function_fetch_afu(9)ocxl_afu_get(9)ocxl_afu_put(9)ocxl_function_config(9)ocxl_function_close(9)ocxl_context_alloc(9)ocxl_context_free(9)ocxl_context_detach(9)ocxl_afu_irq_alloc(9)ocxl_afu_irq_free(9)ocxl_afu_irq_get_addr(9)ocxl_irq_set_handler(9)ocxl_afu_config(9)ocxl_afu_set_private(9)ocxl_afu_get_private(9)ocxl_global_mmio_read32(9)ocxl_global_mmio_read64(9)ocxl_global_mmio_write32(9)ocxl_global_mmio_write64(9)ocxl_global_mmio_set32(9)ocxl_global_mmio_set64(9)ocxl_global_mmio_clear32(9)ocxl_global_mmio_clear64(9)
like, the whole roster. 25 entries, all (9), all here. iykyk π
π reminder bestie: it's 0 for success, negative for failure. don't be out here checking for positive numbers like it's some other function. that's not the vibe.
and that's the page!! π this one lives under ./include/misc, from the Kernel API Manual, dated October 2026 β mwah, tysm for reading, go attach some contexts responsibly π§π
π¦ 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