tools/testing/cxl: Introduce a mock memory device + driver
authorDan Williams <dan.j.williams@intel.com>
Thu, 9 Sep 2021 05:13:21 +0000 (22:13 -0700)
committerDan Williams <dan.j.williams@intel.com>
Tue, 21 Sep 2021 21:09:34 +0000 (14:09 -0700)
commit7d3eb23c4ccf457b52cafdca1a7b20cddf29e021
treefe3deb591d4ad3dbac2e44e2d0cc376384354f95
parent49be6dd807511db31809000a7b9d430b18d5e780
tools/testing/cxl: Introduce a mock memory device + driver

Introduce an emulated device-set plus driver to register CXL memory
devices, 'struct cxl_memdev' instances, in the mock cxl_test topology.
This enables the development of HDM Decoder (Host-managed Device Memory
Decoder) programming flow (region provisioning) in an environment that
can be updated alongside the kernel as it gains more functionality.

Whereas the cxl_pci module looks for CXL memory expanders on the 'pci'
bus, the cxl_mock_mem module attaches to CXL expanders on the platform
bus emitted by cxl_test.

Acked-by: Ben Widawsky <ben.widawsky@intel.com>
Reported-by: kernel test robot <lkp@intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/163116440099.2460985.10692549614409346604.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/cxl/core/pmem.c
drivers/cxl/cxl.h
drivers/cxl/pmem.c
tools/testing/cxl/Kbuild
tools/testing/cxl/mock_pmem.c [new file with mode: 0644]
tools/testing/cxl/test/Kbuild
tools/testing/cxl/test/cxl.c
tools/testing/cxl/test/mem.c [new file with mode: 0644]