[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250715191143.1023512-1-rrichter@amd.com>
Date: Tue, 15 Jul 2025 21:11:23 +0200
From: Robert Richter <rrichter@....com>
To: Alison Schofield <alison.schofield@...el.com>, Vishal Verma
<vishal.l.verma@...el.com>, Ira Weiny <ira.weiny@...el.com>, Dan Williams
<dan.j.williams@...el.com>, Jonathan Cameron <Jonathan.Cameron@...wei.com>,
Dave Jiang <dave.jiang@...el.com>, Davidlohr Bueso <dave@...olabs.net>
CC: <linux-cxl@...r.kernel.org>, <linux-kernel@...r.kernel.org>, Gregory Price
<gourry@...rry.net>, "Fabio M. De Francesco"
<fabio.m.de.francesco@...ux.intel.com>, Terry Bowman <terry.bowman@....com>,
Robert Richter <rrichter@....com>
Subject: [PATCH v1 00/20] cxl: Address translation support, part 2: Region code rework
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
Powered by blists - more mailing lists