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: <aWfe-r7uEV-ajfhX@gourry-fedora-PF4VCD3F>
Date: Wed, 14 Jan 2026 13:22:50 -0500
From: Gregory Price <gourry@...rry.net>
To: Alison Schofield <alison.schofield@...el.com>
Cc: linux-cxl@...r.kernel.org, linux-kernel@...r.kernel.org,
	kernel-team@...a.com, dave@...olabs.net,
	jonathan.cameron@...wei.com, dave.jiang@...el.com,
	vishal.l.verma@...el.com, ira.weiny@...el.com,
	dan.j.williams@...el.com
Subject: Re: [PATCH v2 1/3] drivers/cxl: introduce cxl_region_driver field
 for cxl_region

On Wed, Jan 14, 2026 at 10:15:28AM -0800, Alison Schofield wrote:
> On Tue, Jan 13, 2026 at 03:21:36PM -0500, Gregory Price wrote:
> > The CXL driver presently has 3 modes of managing a cxl_region:
> >   - no specific driver (bios-onlined SystemRAM)
> >   - dax_region (all other RAM regions, for now)
> >   - pmem_region (all PMEM regions)
> > 
> > Formalize these into specific "region drivers".
> > 
> > enum cxl_region_driver {
> > 	CXL_REGION_DRIVER_NONE,
> > 	CXL_REGION_DRIVER_DAX,
> > 	CXL_REGION_DRIVER_PMEM
> > };
> > 
> > $cat regionN/region_driver
> > [none,dax,pmem]
> > 
> > The intent is to clarify how to to add additional drivers (sysram,
> > dynamic_capacity, etc) in the future, and to allow switching the
> > driver selection via a sysfs entry `regionN/region_driver`.
> 
> Needs description in Documentation/ABI/testing/sysfs-bus-cxl
> I think that will help me understand the switching we expect
> to support.
>

Can do.

> > +	/* PMEM drivers cannot be changed */
> > +	if (cxlr->mode == CXL_PARTMODE_PMEM)
> > +		return -EBUSY;
> 
> why isn't above "if (cxlr->driver == CXL_REGION_DRIVER_PMEM)"
>

I wanted to future-proof against someone trying to do something silly
like changing PMEM to come up as REGION_DRIVER_NONE and then scootching
past the check here.  But I can change to

if (cxlr->mode == CXL_PARTMODE_PMEM ||
    cxlr->driver CXL_REGION_DRIVER_PMEM)

to make this even more explicit.

~Gregory

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ