Linux CXL
 help / color / mirror / Atom feed
* [PATCH v4 0/2] cxl/region: add interleave capability check
@ 2024-04-22  9:13 Yao Xingtao
  2024-04-22  9:13 ` [PATCH v4 1/2] cxl/core: add passthrough flag to struct cxl_switch_decoder Yao Xingtao
  2024-04-22  9:13 ` [PATCH v4 2/2] cxl/region: check interleave capability Yao Xingtao
  0 siblings, 2 replies; 14+ messages in thread
From: Yao Xingtao @ 2024-04-22  9:13 UTC (permalink / raw)
  To: dave, jonathan.cameron, dave.jiang, alison.schofield,
	vishal.l.verma, ira.weiny, dan.j.williams, jim.harris
  Cc: linux-cxl, Yao Xingtao

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


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2024-05-24  9:15 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-22  9:13 [PATCH v4 0/2] cxl/region: add interleave capability check Yao Xingtao
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)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox