Skip to content

cxl: Repair poison enumeration regressions

Richard Cheng linux-cxl lkml 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v9 Latest4 patches 0 repliesNew
  2. v84 patches 7 repliesSuperseded

Patches in v9 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4cxl/region: Scan all partitions for unmapped poisondrivers/cxl/core/region.c+1 -10 replies
2/4cxl/region: Don't leak tolerated RAM -EFAULT from unmapped poison scandrivers/cxl/core/region.c+3 -10 replies
3/4cxl/region: Start unmapped poison scan at the committed decoder boundarydrivers/cxl/core/region.c+8 -60 replies
4/4cxl/memdev: Don't overwrite the error from an earlier partition poison querydrivers/cxl/core/core.h drivers/cxl/core/memdev.c drivers/cxl/core/region.c+15 -80 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchDave JiangAlison SchofieldJonathan CameronDavidlohr Bueso
1/4R-b R-b T-b R-b R-b
2/4R-b R-b R-b R-b
3/4R-b R-b R-b R-b
4/4R-b R-b R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v9 thread

Cover letter [PATCH v9 0/4] cxl: Repair poison enumeration regressions

This series repairs four poison enumeration regressions introduced by commit be5cbd084027 ("cxl: Kill enum cxl_decoder_mode"). This revision rebases the four patches from v8 [1] onto Linus's v7.3 tag and incorporates the review feedback.

Patch 1: cxl_get_poison_unmapped() ends the partition walk when it encounters a fully mapped partition. Continue to the next partition instead, so unmapped poison in later partitions is still collected.

Patch 2: the unmapped scan tolerates -EFAULT for RAM partitions but leaves the error in rc. If no later query overwrites rc, enumeration incorrectly reports failure. Clear rc before continuing past the tolerated error.

Patch 3: use the ctx->offset handoff from the committed-decoder walk as the starting point for the unmapped scan. Starting after the highest DPA allocation leaves ranges allocated to uncommitted decoders unqueried. Resume at the committed boundary and scan later partitions from their beginning. Also reset both the partition and offset when falling back to scanning all partitions, as suggested by Alison.

Patch 4: cxl_get_poison_by_memdev() can overwrite an earlier partition query failure with a later success. Stop on the first error that is not already tolerated as a RAM -EFAULT, preserving the failure. Introduce a shared poison_efault_forgiven() helper in core.h and use it in the memdev and region poison paths, as suggested by Davidlohr.

Changes since v8 [1]:
- Rebase onto Linus's v7.3 tag
- Keep patches 1 and 2 functionally unchanged
- Patch 3: Reset ctx.offset and ctx.part, suggested by Alison Schofield
- Patch 4: Introduce poison_efault_forgiven(), suggested by Davidlohr Bueso.
The helper was present on v8's base but absent from v7.3

Best regards,
Richard Cheng.

Richard Cheng (4):
cxl/region: Scan all partitions for unmapped poison cxl/region: Don't leak tolerated RAM -EFAULT from unmapped poison scan cxl/region: Start unmapped poison scan at the committed decoder
boundary
cxl/memdev: Don't overwrite the error from an earlier partition poison
query

 drivers/cxl/core/core.h   |  9 +++++++++
 drivers/cxl/core/memdev.c |  8 +++-----
 drivers/cxl/core/region.c | 24 ++++++++++++++----------
 3 files changed, 26 insertions(+), 15 deletions(-)

base-commit: c03c1a14507dfaf8b856c2608f9ac216021fc222

Signature · 1 line
2.43.0