linux-cxl.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 00/18] Initial CXL.cache device support
@ 2025-08-12 21:29 Ben Cheatham
  2025-08-12 21:29 ` [RFC PATCH 01/18] cxl/mem: Change cxl_memdev_ops to cxl_dev_ops Ben Cheatham
                   ` (18 more replies)
  0 siblings, 19 replies; 55+ messages in thread
From: Ben Cheatham @ 2025-08-12 21:29 UTC (permalink / raw)
  To: linux-cxl; +Cc: Ben Cheatham

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

	I plan on submitting a reference driver (type 1 or 2) with v1, I
	figured I'd send out what I have before going much further.

2) Mapping/Reserving host memory used for CXL cache(s)

	I'm thinking this will be handled by the endpoint driver, but I'm
	not sure what mechanism would be used and whether to integrate it
	with the cxl_cache/core. Any thoughts/ideas here are appreciated!

3) RAS Support

	Same situation as 1) above.

Some quick notes: The actual cache parts of this set are untested due
to problems with my set up, but I did make sure nothing here breaks type
3 support. I'll have this fixed before sending out a v1. This series is
based on the for-6.18/cxl-probe-order (commit 5e29cbd1077b) branch in
the CXL repo, with v7 of Dave's deferred dport probe set on top [1]. I
added Dave's set to help with getting around constraints with HDM
decoders in CXL.cache device only configurations (see 08/18 for more).

Patch Breakdown:
	- 1 & 2: Preliminary changes for struct cxl_cachedev
	- 3: Add struct cxl_cachedev
	- 4-8: Preliminary changes for adding cache devices to port
	  hierarchy
	- 9: Function for getting CXL cache info
	- 10: cxl_cache driver (mirrors cxl_mem)
	- 11-16: Checking CXL.cache capabilities for system configuration
	  validity
	- 17-18: Cache device attributes

[1]:
Link: https://lore.kernel.org/linux-cxl/20250714223527.461147-1-dave.jiang@intel.com/

Ben Cheatham (18):
  cxl/mem: Change cxl_memdev_ops to cxl_dev_ops
  cxl: Move struct cxl_dev_state definition
  cxl/core: Add CXL.cache device struct
  cxl: Replace cxl_mem_find_port() with cxl_dev_find_port()
  cxl: Change cxl_ep_load() to use struct device * parameter
  cxl/port, mem: Make adding an endpoint device type agnostic
  cxl/port: Split endpoint port probe on device type
  cxl/port: Update switch_port_probe() for CXL cache devices
  cxl/core: Add function for getting CXL cache info
  cxl/cache: Add cxl_cache driver
  cxl/core: Add CXL snoop filter setup and checking
  cxl/cache: Add CXL Cache ID Route Table mapping
  cxl/cache: Implement Cache ID Route Table programming
  cxl/cache: Add Cache ID Decoder capability mapping
  cxl/cache: Implement Cache ID Decoder programming
  cxl/cache: Add cache device counting for CXL ports
  cxl/core: Add cache device attributes
  cxl/core: Add cache device cache management attributes

 drivers/cxl/Kconfig         |  14 +
 drivers/cxl/Makefile        |   2 +
 drivers/cxl/cache.c         | 276 +++++++++++++++++++
 drivers/cxl/core/Makefile   |   1 +
 drivers/cxl/core/cachedev.c | 292 ++++++++++++++++++++
 drivers/cxl/core/hdm.c      |  31 +++
 drivers/cxl/core/memdev.c   |   2 +-
 drivers/cxl/core/pci.c      | 134 ++++++++++
 drivers/cxl/core/port.c     | 518 +++++++++++++++++++++++++++++++++---
 drivers/cxl/core/region.c   |  25 +-
 drivers/cxl/core/regs.c     |  28 ++
 drivers/cxl/cxl.h           | 193 +++++++++++++-
 drivers/cxl/cxlcache.h      |  42 +++
 drivers/cxl/cxlmem.h        | 121 +--------
 drivers/cxl/cxlpci.h        |  10 +
 drivers/cxl/mem.c           |  14 +-
 drivers/cxl/pci.c           |   2 +-
 drivers/cxl/port.c          |  54 ++--
 drivers/cxl/private.h       |   8 +-
 19 files changed, 1569 insertions(+), 198 deletions(-)
 create mode 100644 drivers/cxl/cache.c
 create mode 100644 drivers/cxl/core/cachedev.c
 create mode 100644 drivers/cxl/cxlcache.h

-- 
2.34.1


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

end of thread, other threads:[~2025-08-26 10:44 UTC | newest]

Thread overview: 55+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-12 21:29 [RFC PATCH 00/18] Initial CXL.cache device support Ben Cheatham
2025-08-12 21:29 ` [RFC PATCH 01/18] cxl/mem: Change cxl_memdev_ops to cxl_dev_ops Ben Cheatham
2025-08-12 21:29 ` [RFC PATCH 02/18] cxl: Move struct cxl_dev_state definition Ben Cheatham
2025-08-19 11:33   ` Jonathan Cameron
2025-08-22 18:00     ` Cheatham, Benjamin
2025-08-12 21:29 ` [RFC PATCH 03/18] cxl/core: Add CXL.cache device struct Ben Cheatham
2025-08-19 11:48   ` Jonathan Cameron
2025-08-22 18:00     ` Cheatham, Benjamin
2025-08-12 21:29 ` [RFC PATCH 04/18] cxl: Replace cxl_mem_find_port() with cxl_dev_find_port() Ben Cheatham
2025-08-12 21:29 ` [RFC PATCH 05/18] cxl: Change cxl_ep_load() to use struct device * parameter Ben Cheatham
2025-08-12 21:29 ` [RFC PATCH 06/18] cxl/port, mem: Make adding an endpoint device type agnostic Ben Cheatham
2025-08-19 11:53   ` Jonathan Cameron
2025-08-22 18:00     ` Cheatham, Benjamin
2025-08-12 21:29 ` [RFC PATCH 07/18] cxl/port: Split endpoint port probe on device type Ben Cheatham
2025-08-19 11:57   ` Jonathan Cameron
2025-08-22 18:01     ` Cheatham, Benjamin
2025-08-12 21:29 ` [RFC PATCH 08/18] cxl/port: Update switch_port_probe() for CXL cache devices Ben Cheatham
2025-08-19 12:03   ` Jonathan Cameron
2025-08-22 18:01     ` Cheatham, Benjamin
2025-08-12 21:29 ` [RFC PATCH 09/18] cxl/core: Add function for getting CXL cache info Ben Cheatham
2025-08-12 21:29 ` [RFC PATCH 10/18] cxl/cache: Add cxl_cache driver Ben Cheatham
2025-08-19 12:11   ` Jonathan Cameron
2025-08-22 18:01     ` Cheatham, Benjamin
2025-08-12 21:29 ` [RFC PATCH 11/18] cxl/core: Add CXL snoop filter setup and checking Ben Cheatham
2025-08-19 14:18   ` Jonathan Cameron
2025-08-22 18:01     ` Cheatham, Benjamin
2025-08-12 21:29 ` [RFC PATCH 12/18] cxl/cache: Add CXL Cache ID Route Table mapping Ben Cheatham
2025-08-19 15:09   ` Jonathan Cameron
2025-08-22 18:01     ` Cheatham, Benjamin
2025-08-12 21:29 ` [RFC PATCH 13/18] cxl/cache: Implement Cache ID Route Table programming Ben Cheatham
2025-08-19 15:07   ` Jonathan Cameron
2025-08-22 18:01     ` Cheatham, Benjamin
2025-08-12 21:29 ` [RFC PATCH 14/18] cxl/cache: Add Cache ID Decoder capability mapping Ben Cheatham
2025-08-19 14:12   ` Alireza Sanaee
2025-08-22 18:01     ` Cheatham, Benjamin
2025-08-12 21:29 ` [RFC PATCH 15/18] cxl/cache: Implement Cache ID Decoder programming Ben Cheatham
2025-08-19 13:44   ` Alireza Sanaee
2025-08-20  8:55     ` Alireza Sanaee
2025-08-19 15:26   ` Jonathan Cameron
2025-08-22 18:01     ` Cheatham, Benjamin
2025-08-12 21:29 ` [RFC PATCH 16/18] cxl/cache: Add cache device counting for CXL ports Ben Cheatham
2025-08-19 15:30   ` Jonathan Cameron
2025-08-22 18:02     ` Cheatham, Benjamin
2025-08-12 21:29 ` [RFC PATCH 17/18] cxl/core: Add cache device attributes Ben Cheatham
2025-08-19 15:38   ` Jonathan Cameron
2025-08-22 18:02     ` Cheatham, Benjamin
2025-08-12 21:29 ` [RFC PATCH 18/18] cxl/core: Add cache device cache management attributes Ben Cheatham
2025-08-19 15:53   ` Jonathan Cameron
2025-08-22 18:02     ` Cheatham, Benjamin
2025-08-13 11:25 ` [RFC PATCH 00/18] Initial CXL.cache device support Alejandro Lucero Palau
2025-08-19 15:57   ` Jonathan Cameron
2025-08-19 16:05     ` Jonathan Cameron
2025-08-26 10:42       ` Alejandro Lucero Palau
2025-08-22 18:02   ` Cheatham, Benjamin
2025-08-26 10:44     ` Alejandro Lucero Palau

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