lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aQ4XXcxRidI3-kjI@rric.localdomain>
Date: Fri, 7 Nov 2025 16:59:25 +0100
From: Robert Richter <rrichter@....com>
To: Dave Jiang <dave.jiang@...el.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>,
	Davidlohr Bueso <dave@...olabs.net>, 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>,
	Joshua Hahn <joshua.hahnjy@...il.com>
Subject: Re: [PATCH v4 06/14] cxl/region: Separate region parameter setup and
 region construction

On 03.11.25 15:05:28, Dave Jiang wrote:
> 
> 
> On 11/3/25 11:47 AM, Robert Richter 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@...rry.net>
> > Signed-off-by: Robert Richter <rrichter@....com>
> 
> Just a small thing below, otherwise
> Reviewed-by: Dave Jiang <dave.jiang@...el.com>
> 
> > ---
> >  drivers/cxl/core/core.h   |  9 +++++++++
> >  drivers/cxl/core/region.c | 32 +++++++++++++++++++++-----------
> >  2 files changed, 30 insertions(+), 11 deletions(-)
> > 
> > diff --git a/drivers/cxl/core/core.h b/drivers/cxl/core/core.h
> > index 1fb66132b777..2bc37f3aee21 100644
> > --- a/drivers/cxl/core/core.h
> > +++ b/drivers/cxl/core/core.h
> > @@ -19,6 +19,15 @@ enum cxl_detach_mode {
> >  };
> >  
> >  #ifdef CONFIG_CXL_REGION
> > +
> > +struct cxl_region_context {
> > +	struct cxl_endpoint_decoder *cxled;
> > +	struct cxl_memdev *cxlmd;
> 
> cxlmd may not be needed.
> 
> struct cxl_memdev *cxlmd = cxled_to_memdev(cxlr_ctx->cxled);
> 
> which you used later on in this patch to init the cxlmd member :)

This was on purpose to eliminate an unnecessary frequent call of
cxled_to_memdev() while holding the context. There is at least a
3-level pointer chasing to get to cxlmd.

Maybe it's wort to add it to struct cxl_endpoint_decoder.

-Robert

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ