From: alison.schofield@intel.com
To: Davidlohr Bueso <dave@stgolabs.net>,
Jonathan Cameron <jonathan.cameron@huawei.com>,
Dave Jiang <dave.jiang@intel.com>,
Alison Schofield <alison.schofield@intel.com>,
Vishal Verma <vishal.l.verma@intel.com>,
Ira Weiny <ira.weiny@intel.com>,
Dan Williams <dan.j.williams@intel.com>
Cc: linux-cxl@vger.kernel.org
Subject: [PATCH v4 0/5] cxl: Support Poison Inject & Clear by Region Offset
Date: Tue, 22 Jul 2025 13:47:39 -0700 [thread overview]
Message-ID: <cover.1753214969.git.alison.schofield@intel.com> (raw)
From: Alison Schofield <alison.schofield@intel.com>
Built upon cxl repo branch cxl/next
Please excuse the checkpatch errors in new ACQUIRE syntax.
A CXL Unit Test update to cxl-poison.sh is posted separately.
A stand-alone test of the SPA<=>HPA<=>DPA of calculations is here:
https://github.com/pmem/ndctl/commit/0b5ae6882d882145f671c6d6bd9a4fc1edb4b99d
Changes in v4:
Changelog appears per patch also.
Add new precursor patch creating a root decoder ops structure (DaveJ)
Add /* Input validation ensures valid ways and gran */ (Jonathan)
Use a temp instead of modifying hpa_offset in place (Jonathan)
Reorder mask addends to match spec definition (Jonathan)
Add a blank line, remove a blank line (Jonathan)
s/Deivce/Device in commit log (Jonathan)
Use div64_u64_rem() for MOD operation (lkp)
Simplify return in cxl_[inject|clear]_poison() (Jonathan)
Changes in v3:
Check return of ways_to_eiw() & granularity_to_eig() (Jonathan)
Collapse a header comment into pos and offset blocks (Jonathan)
Calc pos for 3,6,12 using actual ways, not always 3 (Jonathan)
Mask off bottom bits in < 8 offset case (Jonathan)
Wrap code comments closer to column 80 (Jonathan)
Use a continue to un-nest a for loop. (Jonathan)
Undo v2 return of rc from locked variants. Return 0. (Jonathan)
Return rc from region_offset_to_dpa_result() if present (Jonathan)
Remove the errant Documentation/ABI fixup (Jonathan)
Add the above rc to the dev_dbg message
Changes in v2:
Rebased onto cxl repo branch for-6.17/cxl-acquire
As the ACQUIRE() set noted, ACQUIRE() syntax leads to a checkpatch
ERROR: do not use assignment in if condition
We'll have to endure that noise here until that set is merged with
a checkpatch.pl update or a change to the syntax.
Changelog appears per patch also:
Simplify return using test_bit() in cxl_memdev_has_poison() (Jonathan)
Use ACQUIRE() in the debugfs inject and clear funcs (DaveJ, Jonathan)
Shift by (eig + eiw) not (eig + 8) in MOD 3 interleaves** (Jonathan)
Simplify bottom bit handling by saving and restoring (Jonathan)
Return the rc from locked variants in cxl_clear/inject_poison
Fail if offset is in the extended linear cache (Jonathan)
Calculate the pos and dpa_offset inline, not in a helper
Remove the not customary __ prefix from locked variants
Added 'cxl' to an existing ABI for memdev clear_poison
Add and use a root decoder callback for spa_to_hpa()
Redefine ABI to take a region offset, not SPA (Dan)
Use div64_u64 instead of / to fix 32-bit ARM (lkp)
Use div64_u64_rem instead of % for arch safety
Remove KernelVersion field in ABI doc (Dan)
Pass pointer to results structures (DaveJ)
Add spec references and comments (DaveJ)
Warn against misuse in ABI doc (Dan)
Add validate_region_offset() helper
Begin Cover Letter
This series allows expert users to inject and clear poison by writing a
Host Physical Address (HPA) to a region debugfs files. At the core of this
new functionality is a helper that translates an HPA into a Device Physical
Address (DPA) and a memdev based on the region's decoder configuration.
The set is not merely a convenience wrapper for these region poison
operations as it enables these operations for XOR interleaved regions
where they were previously impossible.
Patch 1 is a new precursor patch creating a root decoder ops structure.
Patch 2 defines a SPA->CXL HPA root decoder callback for XOR Math. It's a
restructuring and renaming exercise that enables the reuse of an existing
xormap function in either direction SPA<-->CXL HPA. It gets used in Patch 2.
Patch 3 introduces the translation logic capable of retrieving the memdev
and a DPA for a region offset.
Patch 4 adds a locked variant of the inject and clear poison ops to
support callers that must hold locks during the entire translation and
operation sequence. It gets used in Patch 5.
Patch 5 exposes the capability through region debugfs attributes that
only appear when all participating memdevs support the poison commands.
By the end of Patch 5 a region offset has been translated to a memdev
and a DPA and can simply be passed through to the pre-existing per memdev
inject and clear poison routines.
Alison Schofield (4):
cxl: Define a SPA->CXL HPA root decoder callback for XOR Math
cxl/region: Introduce SPA to DPA address translation
cxl/core: Add locked variants of the poison inject and clear funcs
cxl/region: Add inject and clear poison by region offset
Dave Jiang (1):
cxl: Move hpa_to_spa callback to a new root decoder ops structure
Documentation/ABI/testing/debugfs-cxl | 87 ++++++++++
drivers/cxl/acpi.c | 35 ++--
drivers/cxl/core/core.h | 4 +
drivers/cxl/core/memdev.c | 60 +++++--
drivers/cxl/core/port.c | 2 +
drivers/cxl/core/region.c | 237 +++++++++++++++++++++++++-
drivers/cxl/cxl.h | 14 +-
drivers/cxl/cxlmem.h | 2 +
8 files changed, 406 insertions(+), 35 deletions(-)
base-commit: 3a32c5b3bb7d2dfad5fab94817f59e8963e2b1a6
--
2.37.3
next reply other threads:[~2025-07-22 20:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-22 20:47 alison.schofield [this message]
2025-07-22 20:47 ` [PATCH v4 1/5] cxl: Move hpa_to_spa callback to a new root decoder ops structure alison.schofield
2025-07-22 20:47 ` [PATCH v4 2/5] cxl: Define a SPA->CXL HPA root decoder callback for XOR Math alison.schofield
2025-07-22 20:47 ` [PATCH v4 3/5] cxl/region: Introduce SPA to DPA address translation alison.schofield
2025-07-22 20:47 ` [PATCH v4 4/5] cxl/core: Add locked variants of the poison inject and clear funcs alison.schofield
2025-07-22 20:47 ` [PATCH v4 5/5] cxl/region: Add inject and clear poison by region offset alison.schofield
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1753214969.git.alison.schofield@intel.com \
--to=alison.schofield@intel.com \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=ira.weiny@intel.com \
--cc=jonathan.cameron@huawei.com \
--cc=linux-cxl@vger.kernel.org \
--cc=vishal.l.verma@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).