From: "Zhijian Li (Fujitsu)" <lizhijian@fujitsu.com>
To: Dan Williams <dan.j.williams@intel.com>,
Gregory Price <gourry@gourry.net>,
"linux-cxl@vger.kernel.org" <linux-cxl@vger.kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"kernel-team@meta.com" <kernel-team@meta.com>,
"vishal.l.verma@intel.com" <vishal.l.verma@intel.com>,
"dave.jiang@intel.com" <dave.jiang@intel.com>,
"dave@stgolabs.net" <dave@stgolabs.net>,
"jonathan.cameron@huawei.com" <jonathan.cameron@huawei.com>,
"alison.schofield@intel.com" <alison.schofield@intel.com>,
"ira.weiny@intel.com" <ira.weiny@intel.com>,
"Yasunori Gotou (Fujitsu)" <y-goto@fujitsu.com>
Subject: Re: [PATCH v2] cxl: core/region - ignore interleave granularity when ways=1
Date: Thu, 3 Apr 2025 08:31:22 +0000 [thread overview]
Message-ID: <e4a51edf-2188-4a49-b807-20ab10eadad1@fujitsu.com> (raw)
In-Reply-To: <67ee11cf28f2e_464ec2949a@dwillia2-xfh.jf.intel.com.notmuch>
Hi Dan
I am grateful for your prompt response.
On 03/04/2025 12:42, Dan Williams wrote:
> Zhijian Li (Fujitsu) wrote:
>> Hi Gregory and CXL community
>> Cc Goto-san
>>
>> | |
>> decoder9.0 decoder10.0
>> IW:1 IG:1024 IW:1 IG:1024
>
> Why 1024? Yes, the value does not matter, but attempting 1024 feels more
> like a unit test than a production use case.
I am uncertain, it appears to be this way when we get the device.
I presume it should not be a side effect in no-interleaving case.
Thank you for your answers to these questions. Your reply has truly
cleared up my confusion. Once again, thank you!
Thanks
Zhijian
>>
>> My question are:
>> Q1: whether "granularity is a don't care if not interleaving" is applied to
>> all HDM decoders(including root decoder and HDM decoder)
>
> All decoders.>
>> In current cxl cli , it will not show any interleave_granularity at all when ways==1(no-interleaving)
>> $ cxl list -PDE | grep granularity # show nothing when ways==1
>
> Right, because the value theoretically has no functional impact in the
> ways==1 case. However, it errantly ends up having practical impact in
> these corners cases where code performs granularity comparisons without
> considering that ways may be 1.
>
>> Per the CXL Spec r3.1
>> IG: "The number of consecutive bytes that are assigned to each target in the Target List."
>> Q2: Does this imply a configuration where the number of ways>1?
>
> Right, the granularity is the boundary at which the decoder switches to
> the next target in the target list. When ways=1 granularity can be
> infinity or zero by that definition.
>
>> Q3: Does the IG also represent the device's capabilities? When programming, should one also
>> consider whether the device supports it?
>
> Yes, see bits [9:8] in the CXL HDM Decoder Capability Register (CXL 3.2
> 8.2.4.20.1). So even though the math should not matter, I would still
> expect the driver to try to be careful to make sure that IG+8 is less
> than the address-bit max.
>
>> If "granularity is a don't care if not interleaving" is true, how about below changes
>
> Part of me says, "yes, that should be ok", another part of me says "what
> is the practical benefit of allowing any granularity to be specified?".
>
> So the fix from Gregory is limited to the case of "whoops, the platform
> BIOS thought this was a good idea even though it does not matter in
> practice, teach Linux to be lenient in this case.".
>
> The proposal to accept that in all case allows user-created regions to
> have odd large granularity sizes in the iw=1 case, and I am skeptical
> it is worth supporting that now.
next prev parent reply other threads:[~2025-04-03 8:32 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-02 23:25 [PATCH v2] cxl: core/region - ignore interleave granularity when ways=1 Gregory Price
2025-04-03 0:00 ` Dan Williams
2025-04-03 1:12 ` Zhijian Li (Fujitsu)
2025-04-03 4:25 ` Yasunori Gotou (Fujitsu)
2025-04-03 4:57 ` Dan Williams
2025-04-03 4:42 ` Dan Williams
2025-04-03 8:31 ` Zhijian Li (Fujitsu) [this message]
2025-04-04 13:40 ` Jonathan Cameron
2025-04-06 18:38 ` Davidlohr Bueso
2025-04-07 8:04 ` Zhijian Li (Fujitsu)
2025-04-10 16:26 ` Dave Jiang
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=e4a51edf-2188-4a49-b807-20ab10eadad1@fujitsu.com \
--to=lizhijian@fujitsu.com \
--cc=alison.schofield@intel.com \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=gourry@gourry.net \
--cc=ira.weiny@intel.com \
--cc=jonathan.cameron@huawei.com \
--cc=kernel-team@meta.com \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vishal.l.verma@intel.com \
--cc=y-goto@fujitsu.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