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] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z5zd60Vaiy7Q1zv9@rric.localdomain>
Date: Fri, 31 Jan 2025 15:27:55 +0100
From: Robert Richter <rrichter@....com>
To: Ben Cheatham <benjamin.cheatham@....com>
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>,
	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>
Subject: Re: [PATCH v1 12/29] cxl: Modify address translation callback for
 generic use

On Fri, Jan 17, 2025 at 03:31:40PM -0600, Ben Cheatham wrote:
> On 1/7/25 8:09 AM, Robert Richter wrote:
> > The root decoder address translation callback could be reused for
> > other decoders too. For generic use of the callback, change the
> > function interface to use a decoder argument instead of the root
> > decoder.
> > 
> > Signed-off-by: Robert Richter <rrichter@....com>
> > ---
> >  drivers/cxl/acpi.c        | 4 ++--
> >  drivers/cxl/core/region.c | 2 +-
> >  drivers/cxl/cxl.h         | 5 ++---
> >  3 files changed, 5 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/cxl/acpi.c b/drivers/cxl/acpi.c
> > index cb14829bb9be..b42cffd6751f 100644
> > --- a/drivers/cxl/acpi.c
> > +++ b/drivers/cxl/acpi.c
> > @@ -22,9 +22,9 @@ static const guid_t acpi_cxl_qtg_id_guid =
> >  	GUID_INIT(0xF365F9A6, 0xA7DE, 0x4071,
> >  		  0xA6, 0x6A, 0xB4, 0x0C, 0x0B, 0x4F, 0x8E, 0x52);
> >  
> > -
> > -static u64 cxl_xor_hpa_to_spa(struct cxl_root_decoder *cxlrd, u64 hpa)
> > +static u64 cxl_xor_hpa_to_spa(struct cxl_decoder *cxld, u64 hpa)
> >  {
> > +	struct cxl_root_decoder *cxlrd = to_cxl_root_decoder(&cxld->dev);
> 
> I think this needs to use cxl_find_root_decoder() instead of to_cxl_root_decoder() since the
> cxld is no longer guaranteed to be a root decoder (as per commit message).

cxl_xor_hpa_to_spa() is expected to be used for cxlrd->hpa_to_spa, the
decoder arg is always a root decoder:

 cxlrd->hpa_to_spa(&cxlrd->cxlsd.cxld, hpa);

The decoder must be converted back to a root decoder in that function
which is what to_cxl_root_decoder() does.

Looks correct to me.

-Robert

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ