STRUCT CXL_POISON_STATE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct cxl_poison_state(9) ✨

okay bestie, welcome to the Kernel API Manual πŸ’– β€” this one's a struct page, and it's literally the vibe check for driver poison state info. no cap, it's short but it matters.


🌸 NAME 🌸

struct cxl_poison_state β€” driver poison state info. yep, that's it, that's the whole name. iconic brevity honestly πŸŽ€

πŸ¦‹ SYNOPSIS πŸ¦‹

here's the whole shape of it, bestie β€” do NOT touch the formatting, this is copy-paste sacred:

struct cxl_poison_state {
    u32 max_errors;
    unsigned long enabled_cmds[BITS_TO_LONGS( CXL_POISON_ENABLED_MAX)];
    struct cxl_mbox_poison_out *list_out;
    struct mutex mutex;
 };

look at her. four members. main character energy πŸ‘‘

πŸ’… Members πŸ’…

  • max_errors β€” the max number of media error records the device cache can hold. like, the ceiling, the limit, the cap fr fr πŸ“
  • enabled_cmds β€” every poison command that's enabled in the CEL. all the ones that made the cut, stored as unsigned long enabled_cmds[BITS_TO_LONGS( CXL_POISON_ENABLED_MAX)] ⭐
  • list_out β€” the poison list payload that the device hands back to you. struct cxl_mbox_poison_out *list_out, the actual goods πŸ“¦
  • mutex β€” a struct mutex that protects reads of the poison list. the bouncer at the club, keeping things orderly 🫢

πŸ”₯ Description πŸ”₯

okay so here's the tea β˜• β€” reads of the poison list are synchronized. why? because you do NOT want a reader getting an incomplete list just because their request overlapped another read request of the same DPA range.

and "overlapped" here covers both flavors of mess, so listen up: their request was interrupted by another read request of the same DPA range, or preceded by one. either way, no half-list for you πŸ™ˆ

the receipts on this one? CXL Spec 3.0 Section 8.2.9.8.4.1 β€” go read it, iykyk πŸ“š

lowkey important: the sync is the whole point of the mutex. no mutex, no clean list. periodt πŸ’€

🌈 SEE ALSO 🌈

go poke around the kernel file ./drivers/cxl/cxlmem.h and also say hi to these legends πŸ‘‘:

  • struct cxl_memdev(9)
  • struct cxl_attach_region(9)
  • struct cxl_event_state(9)
  • struct cxl_fw_state(9)
  • struct cxl_security_state(9)
  • struct cxl_memdev_state(9)
  • struct cxl_mem_command(9)
  • struct cxl_hdm(9)

and that's the page, bestie πŸ§šπŸ’œ this lil masterpiece lives over in ./drivers/cxl, dated October 2026, and it answers to struct cxl_poison_state(9) β€” slay, go read some kernel headers, you got this πŸ’–βœ¨

πŸ“¦ where this page comes from