Linux CXL
 help / color / mirror / Atom feed
From: Yao Xingtao <yaoxt.fnst@fujitsu.com>
To: dave@stgolabs.net, jonathan.cameron@huawei.com,
	dave.jiang@intel.com, alison.schofield@intel.com,
	vishal.l.verma@intel.com, ira.weiny@intel.com,
	dan.j.williams@intel.com, jim.harris@samsung.com
Cc: linux-cxl@vger.kernel.org, Yao Xingtao <yaoxt.fnst@fujitsu.com>
Subject: [PATCH v4 0/2] cxl/region: add interleave capability check
Date: Mon, 22 Apr 2024 05:13:48 -0400	[thread overview]
Message-ID: <20240422091350.4701-1-yaoxt.fnst@fujitsu.com> (raw)

Changes:
v3 -> v4:
1. modify variable naming. (Jonathan)
2. add a comment with a specification reference for the interleave bits
   mathematical calculation formula. (Jonathan)
3. add some descriptions about the changes in comment. (Fan)
4. add passthrough flag to struct cxl_switch_decoder. (newly added)

Currently driver does not check the interleave capability of target, it
can attach target to region even if target does not support the interleave
capability. Thus, applications access the memory will occur unexpected
behavior, such as segmentation fault.

Therefore, it is necessary to check the interleave capability of target
before attaching it to region. If the check fails, the attachment
operation should be stopped.

Since the host-bridges with single port and switches with single dport
do not contain one instance of the CXL HDM Decoder Capability Structure,
the above check does not apply to them, driver should skip this pattern.
So when implementing the patch 2, the patch 1 is needed.

Yao Xingtao (2):
  cxl/core: add passthrough flag to struct cxl_switch_decoder
  cxl/region: check interleave capability

 drivers/cxl/core/hdm.c    |  6 ++++
 drivers/cxl/core/region.c | 70 +++++++++++++++++++++++++++++++++++++++
 drivers/cxl/cxl.h         |  4 +++
 drivers/cxl/cxlmem.h      |  1 +
 4 files changed, 81 insertions(+)

-- 
2.37.3


             reply	other threads:[~2024-04-22  9:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-22  9:13 Yao Xingtao [this message]
2024-04-22  9:13 ` [PATCH v4 1/2] cxl/core: add passthrough flag to struct cxl_switch_decoder Yao Xingtao
2024-04-22 11:12   ` Jonathan Cameron
2024-04-22 23:56     ` Xingtao Yao (Fujitsu)
2024-04-23  0:37   ` Dan Williams
2024-04-22  9:13 ` [PATCH v4 2/2] cxl/region: check interleave capability Yao Xingtao
2024-04-22 11:17   ` Jonathan Cameron
2024-04-23  0:02     ` Xingtao Yao (Fujitsu)
2024-04-23  0:59   ` Dan Williams
2024-04-23  2:47     ` Xingtao Yao (Fujitsu)
2024-05-12 23:43       ` Xingtao Yao (Fujitsu)
2024-05-23  9:05         ` Xingtao Yao (Fujitsu)
2024-05-23 18:47         ` Dan Williams
2024-05-24  9:15           ` Xingtao Yao (Fujitsu)

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=20240422091350.4701-1-yaoxt.fnst@fujitsu.com \
    --to=yaoxt.fnst@fujitsu.com \
    --cc=alison.schofield@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=ira.weiny@intel.com \
    --cc=jim.harris@samsung.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=linux-cxl@vger.kernel.org \
    --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