CXL-CLEAR-MEDIA-POISON(1)
π 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