linux-cxl.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] cxl: Support Poison Inject & Clear by Region Offset
@ 2025-07-03  4:03 alison.schofield
  2025-07-03  4:03 ` [PATCH v2 1/4] cxl: Define a SPA->CXL HPA root decoder callback for XOR Math alison.schofield
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: alison.schofield @ 2025-07-03  4:03 UTC (permalink / raw)
  To: Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Ira Weiny, Dan Williams
  Cc: linux-cxl

From: Alison Schofield <alison.schofield@intel.com>

Beware the rename of patchset and individual patches. Mostly just doing
HPA->Region Offset, and HPA->SPA.

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 (updated) 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 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 2 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 4.

Patch 4 exposes the capability through region debugfs attributes that 
only appear when all participating memdevs support the poison commands.

At the end of Patch 4 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.

A CXL Unit Test update to cxl-poison.sh is posted separately.


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

 Documentation/ABI/testing/debugfs-cxl |  89 +++++++++-
 drivers/cxl/acpi.c                    |  30 ++--
 drivers/cxl/core/core.h               |   4 +
 drivers/cxl/core/memdev.c             |  68 +++++---
 drivers/cxl/core/region.c             | 225 ++++++++++++++++++++++++++
 drivers/cxl/cxl.h                     |   3 +
 drivers/cxl/cxlmem.h                  |   2 +
 7 files changed, 390 insertions(+), 31 deletions(-)


base-commit: 6c90a41a7833a6bb2fb17b9f3cafda66ebdf259b
-- 
2.37.3


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2025-07-15 15:20 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-03  4:03 [PATCH v2 0/4] cxl: Support Poison Inject & Clear by Region Offset alison.schofield
2025-07-03  4:03 ` [PATCH v2 1/4] cxl: Define a SPA->CXL HPA root decoder callback for XOR Math alison.schofield
2025-07-03 13:43   ` Jonathan Cameron
2025-07-03  4:03 ` [PATCH v2 2/4] cxl/region: Introduce SPA to DPA address translation alison.schofield
2025-07-03 14:23   ` Jonathan Cameron
2025-07-12  4:17     ` Alison Schofield
2025-07-03  4:03 ` [PATCH v2 3/4] cxl/core: Add locked variants of the poison inject and clear funcs alison.schofield
2025-07-03 14:25   ` Jonathan Cameron
2025-07-12  4:23     ` Alison Schofield
2025-07-03  4:03 ` [PATCH v2 4/4] cxl/region: Add inject and clear poison by region offset alison.schofield
2025-07-03 14:31   ` Jonathan Cameron
2025-07-12  4:40     ` Alison Schofield
2025-07-15 15:20       ` Jonathan Cameron

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).