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: <aFwTyJO8EuKQOOio@rric.localdomain>
Date: Wed, 25 Jun 2025 17:20:40 +0200
From: Robert Richter <rrichter@....com>
To: "Koralahalli Channabasappa, Smita" <Smita.KoralahalliChannabasappa@....com>
Cc: Jonathan Cameron <Jonathan.Cameron@...wei.com>,
	linux-cxl@...r.kernel.org, linux-kernel@...r.kernel.org,
	nvdimm@...ts.linux.dev, linux-fsdevel@...r.kernel.org,
	linux-pm@...r.kernel.org, Davidlohr Bueso <dave@...olabs.net>,
	Dave Jiang <dave.jiang@...el.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>,
	Matthew Wilcox <willy@...radead.org>, Jan Kara <jack@...e.cz>,
	"Rafael J . Wysocki" <rafael@...nel.org>,
	Len Brown <len.brown@...el.com>, Pavel Machek <pavel@...nel.org>,
	Li Ming <ming.li@...omail.com>,
	Jeff Johnson <jeff.johnson@....qualcomm.com>,
	Ying Huang <huang.ying.caritas@...il.com>,
	Yao Xingtao <yaoxt.fnst@...itsu.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Greg KH <gregkh@...uxfoundation.org>,
	Nathan Fontenot <nathan.fontenot@....com>,
	Terry Bowman <terry.bowman@....com>,
	Benjamin Cheatham <benjamin.cheatham@....com>,
	PradeepVineshReddy Kodamati <PradeepVineshReddy.Kodamati@....com>,
	Zhijian Li <lizhijian@...itsu.com>
Subject: Re: [PATCH v4 5/7] cxl/region: Introduce SOFT RESERVED resource
 removal on region teardown

On 09.06.25 18:25:23, Koralahalli Channabasappa, Smita wrote:
> On 6/9/2025 5:54 AM, Jonathan Cameron wrote:
> > On Tue, 3 Jun 2025 22:19:47 +0000
> > Smita Koralahalli <Smita.KoralahalliChannabasappa@....com> wrote:

> > > +static int __cxl_region_softreserv_update(struct resource *soft,
> > > +					  void *_cxlr)
> > > +{
> > > +	struct cxl_region *cxlr = _cxlr;
> > > +	struct resource *res = cxlr->params.res;
> > > +
> > > +	/* Skip non-intersecting soft-reserved regions */
> > > +	if (soft->end < res->start || soft->start > res->end)
> > > +		return 0;
> > > +
> > > +	soft = normalize_resource(soft);
> > > +	if (!soft)
> > > +		return -EINVAL;
> > > +
> > > +	remove_soft_reserved(cxlr, soft, res->start, res->end);
> > > +
> > > +	return 0;
> > > +}
> > > +
> > > +int cxl_region_softreserv_update(void)
> > > +{
> > > +	struct device *dev = NULL;
> > > +
> > > +	while ((dev = bus_find_next_device(&cxl_bus_type, dev))) {
> > > +		struct device *put_dev __free(put_device) = dev;
> > This free is a little bit outside of the constructor and destructor
> > together rules.
> > 
> > I wonder if bus_for_each_dev() is cleaner here or is there a reason
> > we have to have released the subsystem lock + grabbed the device
> > one before calling __cxl_region_softreserv_update?
> 
> Thanks for the suggestion. I will replace the bus_find_next_device() with
> bus_for_each_dev(). I think bus_for_each_dev() simplifies the flow as
> there's also no need to call put_device() explicitly.

That change makes path #1 obsolete (see comments there too). I would
prefer to remove it.

Thanks,

-Robert

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ