[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aMsfpvHmTlfJVMK3@gourry-fedora-PF4VCD3F>
Date: Wed, 17 Sep 2025 16:52:54 -0400
From: Gregory Price <gourry@...rry.net>
To: Robert Richter <rrichter@....com>
Cc: 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>, linux-cxl@...r.kernel.org,
linux-kernel@...r.kernel.org,
"Fabio M. De Francesco" <fabio.m.de.francesco@...ux.intel.com>,
Terry Bowman <terry.bowman@....com>,
Joshua Hahn <joshua.hahnjy@...il.com>
Subject: Re: [PATCH v3 09/11] cxl/region: Lock decoders that need address
translation
On Fri, Sep 12, 2025 at 04:45:11PM +0200, Robert Richter wrote:
> There is only support to translate addresses from an endpoint to its
> parent port, but not in the opposite direction from the parent to the
> endpoint. Thus, the endpoint address range cannot be determined and
> setup manually for a given SPA range of a region. If the parent
> implements the ->to_hpa() callback, address translation is
> needed. Then, forbid reprogramming of the decoders and lock them.
>
> Signed-off-by: Robert Richter <rrichter@....com>
Reviewed-by: Gregory Price <gourry@...rry.net>
> ---
> drivers/cxl/core/region.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
> index 9fb1e9508213..44ea59252ff0 100644
> --- a/drivers/cxl/core/region.c
> +++ b/drivers/cxl/core/region.c
> @@ -3497,6 +3497,16 @@ static int setup_address_translation(struct cxl_endpoint_decoder *cxled,
> return -ENXIO;
> }
>
> + /*
> + * There is only support to translate from the endpoint to its
> + * parent port, but not in the opposite direction from the
> + * parent to the endpoint. Thus, the endpoint address range
> + * cannot be determined and setup manually. If the address range
> + * was translated and modified, forbid reprogramming of the
> + * decoders and lock them.
> + */
> + cxld->flags |= CXL_DECODER_F_LOCK;
> +
> ctx->hpa_range = range;
> ctx->interleave_ways = ways;
> ctx->interleave_granularity = gran;
> --
> 2.39.5
>
Powered by blists - more mailing lists