CXL-CLEAR-MEDIA-POISON(1)

πŸ“¦
version 85 Β· 4 versions
, in arch rolling

πŸ’… CXL-CLEAR-MEDIA-POISON(1) β€” bestie edition ✨

okay so real talk, this is a page from the cxl manual and it's literally about scrubbing bad memory vibes out of your CXL memory device. no cap, the tool is called cxl-clear-media-poison and it does exactly what it says on the tin: clear poison from CXL memory. πŸ§ͺπŸ’–


✨ NAME ✨

cxl-clear-media-poison β€” clear poison from CXL memory 🫢


🌸 SYNOPSIS 🌸

cxl clear-media-poison <memdev> [<options>]

so like, you're clearing poison from a CXL memory device's memory. that's the whole bit. πŸ’…

now, how do you even point at a CXL memdev? three iconic ways, pick your fighter:

  • by device name (e.g. "mem0") πŸ‘‘
  • by device id (that's the "X" in "memX") πŸ”’
  • by host device name (e.g. "0000:35:00.0") πŸ–₯️

wanna know if a device even has poison that can be cleared? use the cxl-list command with the -L/--media-errors option. here's what a device looks like when poison got injected at device physical address (a.k.a. "offset") 0x1000 β€” literally the whole JSON, look at it:

# cxl list -m mem0 -L -u
{
  "memdev":"mem0",
  "ram_size":"1024.00 MiB (1073.74 MB)",
  "ram_qos_class":42,
  "serial":"0x0",
  "numa_node:1,
  "host":"0000:35:00.0",
  "media_errors":[
    {
          "offset":"0x1000",
          "length":64,
          "source":"Injected"
        }
  ]
}

see that media_errors array? that's the poison. yikes. 😭

okay so, a device physical address is required to clear poison from a CXL memdev β€” you can't just vibe your way through this one. the -a/--address option is what you use to say where to clear poison at, and the address can be given in either decimal or hexadecimal. slay. ✨

here's an example using the example device from above:

# cxl clear-media-poison mem0 -a 0x1000
poison cleared at mem0:0x1000

and then you check again:

# cxl list -m mem0 -L -u
{
  "memdev":"mem0",
  "ram_size":"1024.00 MiB (1073.74 MB)",
  "ram_qos_class":42,
  "serial":"0x0",
  "numa_node:1,
  "host":"0000:35:00.0",
  "media_errors":[
  ]
}

media_errors is empty. poison? gone. we love to see it. πŸŽ€πŸ¦‹

if you're wondering how the poison got in there in the first place, see the inject-media-poison command β€” yes, there's a whole command for injecting poison. main character energy honestly. πŸ™ˆ

⚠️ heads up bestie: this command depends on the CXL debug filesystem (normally mounted at "/sys/kernel/debug/cxl") to clear device poison. no debugfs, no clearing. that's just how it is. πŸ’€

πŸŽ€ OPTIONS πŸŽ€

  • -a, --address β€” Device physical address (DPA) to clear poison at. Address can be specified in hex or decimal. πŸ”₯
  • --debug β€” Enable debug output. for when you need to see everything going on. πŸ•΅οΈβ€β™€οΈ

🌈 SEE ALSO 🌈

cxl-list(1) cxl-clear-media-poison(1)

(yes, it references itself. iconic. self-referential queen. πŸ‘‘)


so that's the whole page, bestie β€” go clear some poison, feel powerful, and remember: address goes in -a, debugfs has to be mounted, and the JSON never lies. πŸ’œ

this cutie dropped as part of the cxl manual, version dated 2026-06-30, under the title CXL-CLEAR-MEDIA-POISON(1) β€” mwah, bye! πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from
  • arch rolling: ndctl 85-1 Β· LGPL-2.1-only AND GPL-2.0-only AND CC0-1.0 AND MIT
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms