]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
cxl/region: Add inject and clear poison by region offset
authorAlison Schofield <alison.schofield@intel.com>
Mon, 4 Aug 2025 08:00:13 +0000 (01:00 -0700)
committerDave Jiang <dave.jiang@intel.com>
Tue, 12 Aug 2025 23:02:00 +0000 (16:02 -0700)
commitc3dd67681c70cc95cc2c889b1b58a1667bb1c48b
tree247f67dd45ebceb2a2fe5002e2cd5bdc9eda96fe
parent25a0207828bc52f1ebb6588f9417eb43ca4960a3
cxl/region: Add inject and clear poison by region offset

Add CXL region debugfs attributes to inject and clear poison based
on an offset into the region. These new interfaces allow users to
operate on poison at the region level without needing to resolve
Device Physical Addresses (DPA) or target individual memdevs.

The implementation uses a new helper, region_offset_to_dpa_result()
that applies decoder interleave logic, including XOR-based address
decoding when applicable. Note that XOR decodes rely on driver
internal xormaps which are not exposed to userspace. So, this support
is not only a simplification of poison operations that could be done
using existing per memdev operations, but also it enables this
functionality for XOR interleaved regions for the first time.

New debugfs attributes are added in /sys/kernel/debug/cxl/regionX/:
inject_poison and clear_poison. These are only exposed if all memdevs
participating in the region support both inject and clear commands,
ensuring consistent and reliable behavior across multi-device regions.

If tracing is enabled, these operations are logged as cxl_poison
events in /sys/kernel/tracing/trace.

The ABI documentation warns users of the significant risks that
come with using these capabilities.

A CXL Maturity Map update shows this user flow is now supported.

Signed-off-by: Alison Schofield <alison.schofield@intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Link: https://patch.msgid.link/f3fd8628ab57ea79704fb2d645902cd499c066af.1754290144.git.alison.schofield@intel.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Documentation/ABI/testing/debugfs-cxl
Documentation/driver-api/cxl/maturity-map.rst
drivers/cxl/core/core.h
drivers/cxl/core/memdev.c
drivers/cxl/core/region.c