mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Ankit Agrawal <ankita@nvidia.com>
Cc: Richard Cheng <icheng@nvidia.com>,
	"Lucero Palau, Alejandro" <alejandro.lucero-palau@amd.com>,
	"dave@stgolabs.net" <dave@stgolabs.net>,
	"dave.jiang@intel.com" <dave.jiang@intel.com>,
	"alison.schofield@intel.com" <alison.schofield@intel.com>,
	"vishal.l.verma@intel.com" <vishal.l.verma@intel.com>,
	"djbw@kernel.org" <djbw@kernel.org>,
	"iweiny@kernel.org" <iweiny@kernel.org>,
	"ming.li@zohomail.com" <ming.li@zohomail.com>,
	"gourry@gourry.net" <gourry@gourry.net>,
	"rrichter@amd.com" <rrichter@amd.com>,
	"linux-cxl@vger.kernel.org" <linux-cxl@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Newton Liu <newtonl@nvidia.com>,
	Kristin Chuang <kristinc@nvidia.com>,
	Kai-Heng Feng <kaihengf@nvidia.com>, Koba Ko <kobak@nvidia.com>
Subject: Re: [RFC PATCH 0/3] cxl: Auto-create a region for Type-2 memdev attach
Date: Mon, 28 Sep 2026 18:43:15 +0100	[thread overview]
Message-ID: <20260928184315.05038feb@jic23-hlaptop> (raw)
In-Reply-To: <SAWPR12MB9992678E92777730BE483F6511B08D2@SAWPR12MB999267.namprd12.prod.outlook.com>

On Mon, 28 Sep 2026 05:37:45 +0000
Ankit Agrawal <ankita@nvidia.com> wrote:

> >> > 
> >> > 
> >> > <snip>  
> >> > > I think you are right that this RFC doesn't currently have a production platform
> >> > > where the system FW publishes a Type-2 CFMWS but leaves the EP decoder
> >> > > uncommitted.
> >> > > 
> >> > > However, the config appears to be permitted by the CXL model. A CFMWS describes
> >> > > a FW-established root HPA window and the restrictions governing its use,
> >> > > including Type-2 v.s. Type-3 and volatile v.s. PMEM. The CFMWS def also
> >> > > describes OSPM assigning HPA ranges from those windows to discovered CXL.mem
> >> > > devices [1].    
> >> > 
> >> > 
> >> > Right. I'm not saying this should not be supported, just pointing out the
> >> > use case does not make sense with current BIOS functionality. I think BIOS
> >> > will/could support a config option for just leaving a Type2 HDM uncommitted,
> >> > but then why the kernel should do the same a default BIOS config would do?
> >> >    
> >> 
> >> Agreed. The kernel shouldn't recreate the config that BIOS would normally provide.  
> >
> > I'm a bit lost. Both BIOS doing nothing beyond cfmws as a design decision and
> > hotplug (where bios isn't in the loop) require this sort of flow.
> >
> > Sure both might not be what you happen to have today but they are both
> > very much real usecases!
> >
> > Jonathan  
> 
> So, can we consider doing both in 2 phases..
> 1. Autocreate a default region that is sized to the device's DVSEC reported
> DPA capacity when the platform signals it (applicable only to CFMWS present
> Type-2 CXL.mem-capable, decoder uncommitted case?). I suppose this could
> cover the use cases suggested by Jonathan?
> 2. Let the driver explicitly replace/override it with a different sized region
> once bound per its own policy.

I don't see a reason for 1.  The bios has to have provided a CFMWS that will
work or option 2 will fail - if it supports hotplug or indeed doesn't want to
do config of devices on cold plug it just provides 'enough space'.  Whether it
does that by hard coded big number, bios menu option or otherwise doesn't
matter to us.

But in general a driver should bind before we create anything (assuming we
are in a host OS managed flow).  Why would we want to do anything before that
as we have no idea if a driver will ever bind - or if there is flexibility
in size exposed that can't be known until driver bind.

> 
> >> And that's why I think we should move region createion out of devm_cxl_probe_mem().
> >> That helper should discover and attach to an already committed region.
> >> 
> >> If FW leaves the decoders unconfigured intentionally , a driver may explicitly request a region
> >> and provide the size it needs.
> >> 
> >> In my mind the new model should be
> >> - FW-committed config is only discovered and attached
> >> - an uncommitted config remains untouched unless a driver explicitly requests it
> >> - CXL core supplieds the allocation, validation, programming, accounting and teardown mechnism
> >> - the requesting driver owns the policy and the use of the region  
> 
> Is there going to be a custom non-default size to commit be communicated
> to the vendor driver? AIU currently the size is only driver-internal constant.

Given it is potentially a contended resource, we may need a way to clamp
the maximum a particular instances is allowed to request. For now maybe
first come, first served is good enough? No idea. 

Jonathan

> 
> Thanks
> Ankit Agrawal


      reply	other threads:[~2026-09-28 17:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-05  7:40 Richard Cheng
2026-08-05  7:40 ` [RFC PATCH 1/3] cxl/region: Reset software-created regions on memdev detach Richard Cheng
2026-08-05  7:40 ` [RFC PATCH 2/3] cxl/region: Auto-create a region for memdev attach Richard Cheng
2026-08-12 11:14   ` Alejandro Lucero Palau
2026-08-05  7:40 ` [RFC PATCH 3/3] cxl/test: Exercise Type-2 automatic region creation Richard Cheng
2026-08-12  9:58 ` [RFC PATCH 0/3] cxl: Auto-create a region for Type-2 memdev attach Alejandro Lucero Palau
2026-08-20  9:41   ` Richard Cheng
2026-08-25  9:50     ` Lucero Palau, Alejandro
2026-08-31  8:52       ` Richard Cheng
2026-09-22  1:25         ` Jonathan Cameron
2026-09-28  5:37           ` Ankit Agrawal
2026-09-28 17:43             ` Jonathan Cameron [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260928184315.05038feb@jic23-hlaptop \
    --to=jic23@kernel.org \
    --cc=alejandro.lucero-palau@amd.com \
    --cc=alison.schofield@intel.com \
    --cc=ankita@nvidia.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=djbw@kernel.org \
    --cc=gourry@gourry.net \
    --cc=icheng@nvidia.com \
    --cc=iweiny@kernel.org \
    --cc=kaihengf@nvidia.com \
    --cc=kobak@nvidia.com \
    --cc=kristinc@nvidia.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ming.li@zohomail.com \
    --cc=newtonl@nvidia.com \
    --cc=rrichter@amd.com \
    --cc=vishal.l.verma@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®