Skip to content

dax/hmem: Add tests for the dax_hmem takeover capability

Dan Williams linux-cxl linux-patches stable 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 36 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9cxl/region: Fix use-after-free from auto assembly failuredrivers/cxl/core/region.c drivers/cxl/cxl.h+57 -36 replies
2/9dax/cxl: Fix HMEM dependenciesdrivers/dax/Kconfig+4 -23 replies
3/9cxl/region: Limit visibility of cxl_region_contains_resource()drivers/cxl/core/region.c drivers/cxl/cxl.h drivers/dax/hmem/hmem.c +1 more+7 -183 replies
4/9cxl/region: Constify cxl_region_resource_contains()drivers/cxl/core/region.c drivers/cxl/cxl.h drivers/dax/hmem/hmem.c+9 -83 replies
5/9dax/hmem: Reduce visibility of dax_cxl coordination symbolsdrivers/dax/hmem/device.c drivers/dax/hmem/hmem.c+2 -23 replies
6/9dax/hmem: Fix singleton confusion between dax_hmem_work and hmem devicesdrivers/dax/bus.h drivers/dax/hmem/device.c drivers/dax/hmem/hmem.c+85 -663 replies
7/9dax/hmem: Parent dax_hmem devicesdrivers/dax/hmem/hmem.c+1 -03 replies
8/9tools/testing/cxl: Simulate auto-assembly failuretools/testing/cxl/test/cxl.c+9 -03 replies
9/9tools/testing/cxl: Test dax_hmem takeover of CXL regionstools/testing/cxl/Kbuild tools/testing/cxl/test/Kbuild tools/testing/cxl/test/cxl.c +4 more+173 -05 replies

Reviews trailers per patch

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

PatchDave JiangAlison SchofieldIra Weiny
1/9R-b R-b R-b
2/9R-b R-b R-b
3/9R-b R-b R-b
4/9R-b R-b R-b
5/9R-b R-b R-b
6/9R-b R-b R-b
7/9R-b R-b R-b
8/9R-b R-b R-b
9/9R-b T-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 3 reviewers.

Read the v1 thread

Cover letter [PATCH 0/9] dax/hmem: Add tests for the dax_hmem takeover capability

Given all the cross subsystem dependencies needed to make this solution work, it needs to have a unit test to keep it functional.

On the path to writing that, several fixes fell out, but not to Smita's code, to mine. One use-after-free has been there since the original automatic region assembly code.

Here is a preview of the core of the test I will submit to the cxl-cli project:

---
modprobe cxl_mock_mem && modprobe cxl_test hmem_test=1

dax=$(find_dax_cxl)
[[ "$dax" == "" ]] && err $LINENO
dax=$(find_dax_hmem)
[[ "$dax" != "" ]] && err $LINENO

unload

modprobe cxl_mock_mem && modprobe cxl_test fail_autoassemble hmem_test=1

dax=$(find_dax_cxl)
[[ "$dax" != "" ]] && err $LINENO
dax=$(find_dax_hmem)
[[ "$dax" == "" ]] && err $LINENO

unload
---

This builds on Smita's series [1] pushed out to for-7.1/dax-hmem in cxl.git [2].

[1]: http://lore.kernel.org/[email protected]
[2]: https://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl.git/log/?h=for-7.1/dax-hmem

Dan Williams (9):
cxl/region: Fix use-after-free from auto assembly failure dax/cxl: Fix HMEM dependencies
cxl/region: Limit visibility of cxl_region_contains_resource() cxl/region: Constify cxl_region_resource_contains() dax/hmem: Reduce visibility of dax_cxl coordination symbols dax/hmem: Fix singleton confusion between dax_hmem_work and hmem
devices
dax/hmem: Parent dax_hmem devices
tools/testing/cxl: Simulate auto-assembly failure tools/testing/cxl: Test dax_hmem takeover of CXL regions

 drivers/dax/Kconfig                |   6 +-
 drivers/cxl/cxl.h                  |  11 ++-
 drivers/dax/bus.h                  |  15 +++-
 include/cxl/cxl.h                  |  15 ----
 tools/testing/cxl/test/mock.h      |   8 ++
 drivers/cxl/core/region.c          |  68 +++++++++++++++--
 drivers/dax/hmem/device.c          |  28 ++++---
 drivers/dax/hmem/hmem.c            | 115 +++++++++++++++--------------
 tools/testing/cxl/test/cxl.c       |  66 +++++++++++++++++
 tools/testing/cxl/test/hmem_test.c |  47 ++++++++++++
 tools/testing/cxl/test/mem.c       |   3 +
 tools/testing/cxl/test/mock.c      |  50 +++++++++++++
 tools/testing/cxl/Kbuild           |   7 ++
 tools/testing/cxl/test/Kbuild      |   1 +
 14 files changed, 344 insertions(+), 96 deletions(-)
 delete mode 100644 include/cxl/cxl.h
 create mode 100644 tools/testing/cxl/test/hmem_test.c

base-commit: 51d2fa02c0e4b3b23c4484f2af9b6d65c35471e8

Signature · 1 line
2.53.0