Skip to content

RFC Initial CXL.cache device support

Ben Cheatham linux-cxl 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 RFC Latest17 patches 16 repliesIn review
  2. v1 RFC18 patches 59 repliesSuperseded

Changes in v2 from the cover letter

- Reworked cache id patches
- Reordered several patches for flow
- Add/delete cxl_cachedev in cxl/core/cachedev.c (Jonathan)
- Add doc for struct cxl_cachedev (Jonathan)
- Updated switch port and endpoint port set up to mesh with new delayed dport set up
- Added comment about why cxl_cache probe is synchronous (Jonathan)
- Bug fixes, cleanups, and renames in snoop filter patch (Jonathan & Dave)
- Removed serial attribute from cxl_cachedev (Jonathan)
- Added NULLs and removed commas from attribute groups (Jonathan)
- Bug fixes for cache management attributes (Dave)
- Added documentation for new cachedev attributes under Documentation/ABI (Dave)

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/17cxl/port: Arrange for always synchronous endpoint attachdrivers/cxl/mem.c drivers/cxl/port.c drivers/cxl/private.h+57 -431 reply
2/17cxl: Move struct cxl_dev_state definitiondrivers/cxl/cxl.h drivers/cxl/cxlmem.h+110 -1090 replies
3/17cxl/core: Add function for getting CXL cache infodrivers/cxl/core/pci.c drivers/cxl/cxl.h drivers/cxl/cxlcache.h +1 more+77 -02 replies
4/17cxl/core: Add CXL.cache device structdrivers/cxl/core/Makefile drivers/cxl/core/cachedev.c drivers/cxl/core/port.c +3 more+131 -01 reply
5/17cxl/cache: Add cxl_cache driverdrivers/cxl/Kconfig drivers/cxl/Makefile drivers/cxl/cache.c +1 more+98 -02 replies
6/17cxl: Replace cxl_mem_find_port() with cxl_dev_find_port()drivers/cxl/core/port.c drivers/cxl/cxl.h drivers/cxl/mem.c +1 more+9 -62 replies
7/17cxl: Change cxl_ep_load() to use struct device * parameterdrivers/cxl/core/port.c drivers/cxl/core/region.c drivers/cxl/cxlmem.h +1 more+18 -170 replies
8/17cxl/core: Update devm_cxl_enumerate_ports()drivers/cxl/cache.c drivers/cxl/core/port.c drivers/cxl/cxl.h +2 more+94 -390 replies
9/17cxl/port: Split endpoint port probe on device typedrivers/cxl/port.c+18 -50 replies
10/17cxl/cache, mem: Prevent RAS register mapping racedrivers/cxl/cache.c drivers/cxl/mem.c+14 -22 replies
11/17cxl/core, port: Update devm_cxl_add_endpoint()drivers/cxl/cache.c drivers/cxl/core/port.c drivers/cxl/cxl.h +3 more+51 -160 replies
12/17cxl/core: Add CXL snoop filter setup and allocationdrivers/cxl/cache.c drivers/cxl/core/port.c drivers/cxl/core/regs.c +1 more+234 -02 replies
13/17cxl/core: Add cache id verificationdrivers/cxl/core/cachedev.c drivers/cxl/core/pci.c drivers/cxl/core/port.c +4 more+344 -42 replies
14/17cxl/port: Add cache id programmingdrivers/cxl/core/port.c drivers/cxl/cxl.h drivers/cxl/port.c+310 -130 replies
15/17cxl/port: Bypass cache id for singleton cache devicesdrivers/cxl/core/port.c drivers/cxl/port.c+33 -20 replies
16/17cxl/core: Add cache device attributesdrivers/cxl/core/cachedev.c+85 -02 replies
17/17cxl/core: Add cache device cache management attributesDocumentation/ABI/testing/sysfs-bus-cxl drivers/cxl/core/cachedev.c drivers/cxl/core/pci.c +2 more+224 -00 replies

Reviews trailers per patch

2 of 17 patches have a Reviewed-by or Acked-by.

PatchJonathan Cameron
1/17
2/17
3/17
4/17R-b
5/17
6/17R-b
7/17
8/17
9/17
10/17
11/17
12/17
13/17
14/17
15/17
16/17
17/17

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [RFC v2 PATCH 00/17] Initial CXL.cache device support

v2 Change log:
- Reworked cache id patches
- Reordered several patches for flow
- Add/delete cxl_cachedev in cxl/core/cachedev.c (Jonathan)
- Add doc for struct cxl_cachedev (Jonathan)
- Updated switch port and endpoint port set up to mesh with new delayed dport set up
- Added comment about why cxl_cache probe is synchronous (Jonathan)
- Bug fixes, cleanups, and renames in snoop filter patch (Jonathan & Dave)
- Removed serial attribute from cxl_cachedev (Jonathan)
- Added NULLs and removed commas from attribute groups (Jonathan)
- Bug fixes for cache management attributes (Dave)
- Added documentation for new cachedev attributes under Documentation/ABI (Dave)

This patch series adds initial CXL.cache support. What I have here only allows for adding a cache device to the system, programming/validating the system configuration with respect to cache devices, and some basic cache reporting/management.

The general philosophy is to have an endpoint/vendor-specific driver that runs through the same steps of adding a cxl_memdev, but for the cache portion of the device (both type 1 & 2). Getting cache support for a CXL device should be as simple as: get cache information, set up the memory region (see below), and then calling devm_cxl_add_cachedev().

There's a couple of things missing from this set:

1) Missing an endpoint driver
2) RAS Support
3) Mapping/Reserving host memory used for CXL cache(s)

I'm thinking the way it will work is the endpoint driver requests a DMA region for the cache, but I haven't looked into it. Any thoughts/ideas are appreciated!

*Important Note*: The first patch is only there for context. It's required for the set to work, but it should be picked up as part of Smita's soft reserved set.

Ben Cheatham (16):
cxl: Move struct cxl_dev_state definition cxl/core: Add function for getting CXL cache info cxl/core: Add CXL.cache device struct
cxl/cache: Add cxl_cache driver
cxl: Replace cxl_mem_find_port() with cxl_dev_find_port()
cxl: Change cxl_ep_load() to use struct device * parameter cxl/core: Update devm_cxl_enumerate_ports() cxl/port: Split endpoint port probe on device type cxl/cache, mem: Prevent RAS register mapping race cxl/core, port: Update devm_cxl_add_endpoint() cxl/core: Add CXL snoop filter setup and allocation cxl/core: Add cache id verification
cxl/port: Add cache id programming
cxl/port: Bypass cache id for singleton cache devices cxl/core: Add cache device attributes
cxl/core: Add cache device cache management attributes

Dan Williams (1):
cxl/port: Arrange for always synchronous endpoint attach

 Documentation/ABI/testing/sysfs-bus-cxl |  31 +
 drivers/cxl/Kconfig                     |  14 +
 drivers/cxl/Makefile                    |   2 +
 drivers/cxl/cache.c                     | 152 +++++
 drivers/cxl/core/Makefile               |   1 +
 drivers/cxl/core/cachedev.c             | 289 ++++++++
 drivers/cxl/core/pci.c                  | 140 ++++
 drivers/cxl/core/port.c                 | 842 ++++++++++++++++++++++--
 drivers/cxl/core/region.c               |  25 +-
 drivers/cxl/core/regs.c                 |  27 +
 drivers/cxl/cxl.h                       | 204 +++++-
 drivers/cxl/cxlcache.h                  |  48 ++
 drivers/cxl/cxlmem.h                    | 113 +---
 drivers/cxl/cxlpci.h                    |  10 +
 drivers/cxl/mem.c                       |  55 +-
 drivers/cxl/pci.c                       |   2 +-
 drivers/cxl/port.c                      | 129 +++-
 drivers/cxl/private.h                   |  19 +
 18 files changed, 1877 insertions(+), 226 deletions(-)
 create mode 100644 drivers/cxl/cache.c
 create mode 100644 drivers/cxl/core/cachedev.c
 create mode 100644 drivers/cxl/cxlcache.h
 create mode 100644 drivers/cxl/private.h
Signature · 1 line
2.51.1