Re: [PATCH v4 06/14] cxl/region: Separate region parameter setup and region construction

Jonathan Cameron
2025-11-11T15:02:56Z

On Mon, 3 Nov 2025 19:47:47 +0100
Robert Richter <rrichter@amd.com> wrote:

> To construct a region, the region parameters such as address range and
> interleaving config need to be determined. This is done while
> constructing the region by inspecting the endpoint decoder
> configuration. The endpoint decoder is passed as a function argument.
>
> With address translation the endpoint decoder data is no longer
> sufficient to extract the region parameters as some of the information
> is obtained using other methods such as using firmware calls.
>
> In a first step, separate code to determine the region parameters from
> the region construction. Temporarily store all the data to create the
> region in the new struct cxl_region_context. Once the region data is
> determined and struct cxl_region_context is filled, construct the
> region.
>
> Patch is a prerequisite to implement address translation. The code
> separation helps to later extend it to determine region parameters
> using other methods as needed, esp. to support address translation.
>
> Reviewed-by: Gregory Price <gourry@gourry.net>
> Signed-off-by: Robert Richter <rrichter@amd.com>
Other than Dave's comment on not holding the cxlmd, looks good to me.
Another one that will clash with Alejandro's rework for type 2 support
though.

Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>