linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 00/20] cxl: Address translation support, part 2: Region code rework
@ 2025-07-15 19:11 Robert Richter
  2025-07-15 19:11 ` [PATCH v1 01/20] cxl/region: Move helper functions closer to their users Robert Richter
                   ` (21 more replies)
  0 siblings, 22 replies; 25+ messages in thread
From: Robert Richter @ 2025-07-15 19:11 UTC (permalink / raw)
  To: Alison Schofield, Vishal Verma, Ira Weiny, Dan Williams,
	Jonathan Cameron, Dave Jiang, Davidlohr Bueso
  Cc: linux-cxl, linux-kernel, Gregory Price, Fabio M. De Francesco,
	Terry Bowman, Robert Richter

This series is the second part of adding support for CXL address
translation. It adds another rework of region code to address
implementation changes or conflicts of current address translation
code with cxl/next, esp. the introduction of support of extended
linear caching.

Following parts are currently planned, worked on or finished:

Part 1: Cleanups and refactoring
Upstream: 68d8b4f399e7 ("Merge branch 'for-6.16/cxl-cleanups' into cxl-for-next")

Part 2: Region code rework
This initial patch series.

Part 3: Extended linear cache rework
Not yet posted.

Part 4: Generic support and AMD Zen5 platform enablement.
Not yet posted. (Earlier version posted as part 2, v2: Generic support
and AMD Zen5 platform enablement. [1])

The general changes in the implementation compared to [1] are in
particular to use the attached region of an endpoint decoder to host
the HPA range and interleaving configuration parameters. That is, the
region's root decoder and HPA range are added as members @cxlrd and
@hpa_range to struct cxl_region. Both are introduced to keep track of
the region's SPA address range and the interleaving configuration.
Those parameters are the same for all endpoint decoders that share the
same interleaving setup.

The implementation must ensure that the endpoint decoder's region
parameters are always valid. All parameters must be determined first
and then a check must be performed if a region with identical
parameters already exists. A split of region creation and registration
is required as the region may not become active and may need to be
replaced by an already existing region. Several high-level functions
are introduced (create_region(), setup_region(), register_region(),
cxl_endpoint_get_region(), cxl_region_find_duplicate()). Most of it is
implemented in cxl_add_to_region().

Finally, this series adds a lot of simplification and improves error
handling and code readability.

[1] https://lore.kernel.org/all/20250218132356.1809075-1-rrichter@amd.com/

Robert Richter (20):
  cxl/region: Move helper functions closer to their users
  cxl/region: Store root decoder in struct cxl_region
  cxl/region: Remove region id handling from cxl_region_alloc()
  cxl/region: Add region registration code to new function
    register_region()
  cxl/region: Separate cxl_region_alloc() from devm_cxl_add_region()
  cxl/region: Remove dev_err() from cxl_find_root_decoder()
  cxl/region: Add new function cxl_endpoint_get_region() to simplify
    cxl_add_to_region()
  cxl/region: Rework memregion id allocation and move it to
    register_region()
  cxl/region: Change __construct_region() to use it as a tail function
    call
  cxl/region: Remove __construct_region()
  cxl/region: Separate auto-generated region cration code path
  cxl/region: Remove region creation code from construct_region()
  cxl/region: Move devm_cxl_add_region() out of create_region()
  cxl/region: Prepare removal of @cxlrd argument from create_region()
  cxl/region: Prepare removal of @cxled argument from construct_region()
  cxl/region: Introduce @hpa_range to struct cxl_region
  cxl/region: Remove create_region() call from construct_region()
  cxl/region: Determine root decoder in create_region()
  cxl/region: Add function to find a region's duplicate
  cxl/region: Early check region's interleaving configuration

 drivers/cxl/core/region.c | 514 +++++++++++++++++++++++---------------
 drivers/cxl/cxl.h         |   4 +
 2 files changed, 315 insertions(+), 203 deletions(-)


base-commit: 12b3d697c812aaf356e82d9e1f351fbb2ea97500
-- 
2.39.5


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

end of thread, other threads:[~2025-07-21 20:59 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-15 19:11 [PATCH v1 00/20] cxl: Address translation support, part 2: Region code rework Robert Richter
2025-07-15 19:11 ` [PATCH v1 01/20] cxl/region: Move helper functions closer to their users Robert Richter
2025-07-15 19:11 ` [PATCH v1 02/20] cxl/region: Store root decoder in struct cxl_region Robert Richter
2025-07-15 19:11 ` [PATCH v1 03/20] cxl/region: Remove region id handling from cxl_region_alloc() Robert Richter
2025-07-15 19:11 ` [PATCH v1 04/20] cxl/region: Add region registration code to new function register_region() Robert Richter
2025-07-15 19:11 ` [PATCH v1 05/20] cxl/region: Separate cxl_region_alloc() from devm_cxl_add_region() Robert Richter
2025-07-21 14:16   ` Joshua Hahn
2025-07-15 19:11 ` [PATCH v1 06/20] cxl/region: Remove dev_err() from cxl_find_root_decoder() Robert Richter
2025-07-15 19:11 ` [PATCH v1 07/20] cxl/region: Add new function cxl_endpoint_get_region() to simplify cxl_add_to_region() Robert Richter
2025-07-15 19:11 ` [PATCH v1 08/20] cxl/region: Rework memregion id allocation and move it to register_region() Robert Richter
2025-07-21 15:06   ` Joshua Hahn
2025-07-15 19:11 ` [PATCH v1 09/20] cxl/region: Change __construct_region() to use it as a tail function call Robert Richter
2025-07-15 19:11 ` [PATCH v1 10/20] cxl/region: Remove __construct_region() Robert Richter
2025-07-15 19:11 ` [PATCH v1 11/20] cxl/region: Separate auto-generated region cration code path Robert Richter
2025-07-15 19:11 ` [PATCH v1 12/20] cxl/region: Remove region creation code from construct_region() Robert Richter
2025-07-15 19:11 ` [PATCH v1 13/20] cxl/region: Move devm_cxl_add_region() out of create_region() Robert Richter
2025-07-15 19:11 ` [PATCH v1 14/20] cxl/region: Prepare removal of @cxlrd argument from create_region() Robert Richter
2025-07-15 19:11 ` [PATCH v1 15/20] cxl/region: Prepare removal of @cxled argument from construct_region() Robert Richter
2025-07-15 19:11 ` [PATCH v1 16/20] cxl/region: Introduce @hpa_range to struct cxl_region Robert Richter
2025-07-15 19:11 ` [PATCH v1 17/20] cxl/region: Remove create_region() call from construct_region() Robert Richter
2025-07-15 19:11 ` [PATCH v1 18/20] cxl/region: Determine root decoder in create_region() Robert Richter
2025-07-15 19:11 ` [PATCH v1 19/20] cxl/region: Add function to find a region's duplicate Robert Richter
2025-07-15 19:11 ` [PATCH v1 20/20] cxl/region: Early check region's interleaving configuration Robert Richter
2025-07-21  0:42 ` [PATCH v1 00/20] cxl: Address translation support, part 2: Region code rework Gregory Price
2025-07-21 20:59 ` Dave Jiang

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