Skip to contentSkip to conversation

CXL XOR Interleave Arithmetic

PATCH Superseded [email protected] 1 participant 4 messages Aug 11, 2022 – Aug 12, 2022

Subsystems (3)

v2 of 9 Superseded Latest is v9 →

lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

v2 cover CXL XOR Interleave Arithmetic

From: Alison Schofield <[email protected]>

Changes in v2:
- Use ilog2() of the decoded interleave ways to determine number of xormaps, instead of using encoded ways directly. This fixes 3, 6, and 12 way interleaves. (Dan)

Add support for the new 'XOR' Interleave Arithmetic as defined in the CXL 3.0 Specification [1].

A linux-ized ACPI patch is included here for reference. The actual pull request is pending at https://github.com/acpica/acpica/pull/787

[1]: https://www.computeexpresslink.org/download-the-specification

Alison Schofield (2):
For ACPICA: Add the CXIMS structure definition to the CEDT table cxl/acpi: Support CXL XOR Interleave Math (CXIMS)

 include/acpi/actbl1.h | 14 ++++++-
 drivers/cxl/cxl.h     |  2 +
 drivers/cxl/acpi.c    | 94 ++++++++++++++++++++++++++++++++++++++++---
 3 files changed, 104 insertions(+), 6 deletions(-)

base-commit: 1cd8a2537eb07751d405ab7e2223f20338a90506

Signature · 1 line
2.31.1
author maintainer
#1 lore raw

PATCH v2 1/2 For ACPICA: Add the CXIMS structure definition to the CEDT table

From: Alison Schofield <[email protected]>

A linux-ized ACPI patch is included here for reference. The actual pull request is pending: https://github.com/acpica/acpica/pull/787

The CXL XOR Interleave Math Structure (CXIMS) is added to the CXL Early Discovery Table (CEDT). This new structure is defined in the CXL 3.0 specification Section 9.17.1.4

https://www.computeexpresslink.org/spec-landing

---
 include/acpi/actbl1.h | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
include/acpi/actbl1.h +13 -1
index 15c78678c5d3..f96f4fe5328d 100644
@@ -329,7 +329,8 @@ struct acpi_cedt_header {
 enum acpi_cedt_type {
 	ACPI_CEDT_TYPE_CHBS = 0,
 	ACPI_CEDT_TYPE_CFMWS = 1,
-	ACPI_CEDT_TYPE_RESERVED = 2,
+	ACPI_CEDT_TYPE_CXIMS = 2,
+	ACPI_CEDT_TYPE_RESERVED = 3,
 };
 
 /* Values for version field above */
@@ -380,6 +381,7 @@ struct acpi_cedt_cfmws_target_element {
 /* Values for Interleave Arithmetic field above */
 
 #define ACPI_CEDT_CFMWS_ARITHMETIC_MODULO   (0)
+#define ACPI_CEDT_CFMWS_ARITHMETIC_XOR	    (1)
 
 /* Values for Restrictions field above */
 
@@ -389,6 +391,16 @@ struct acpi_cedt_cfmws_target_element {
 #define ACPI_CEDT_CFMWS_RESTRICT_PMEM       (1<<3)
 #define ACPI_CEDT_CFMWS_RESTRICT_FIXED      (1<<4)
 
+/* 2: CXL XOR Interleave Math Structure */
+
+struct acpi_cedt_cxims {
+	struct acpi_cedt_header header;
+	u16 reserved1;
+	u8 hbig;
+	u8 nr_xormaps;
+	u64 xormap_list[];
+};
+
 /*******************************************************************************
  *
  * CPEP - Corrected Platform Error Polling table (ACPI 4.0)
Signature · 1 line
2.31.1
author maintainer
#2 lore raw

PATCH v2 2/2 cxl/acpi: Support CXL XOR Interleave Math (CXIMS)

In reply to [email protected]

From: Alison Schofield <[email protected]>

When the CFMWS is using XOR math, parse the corresponding CXIMS structure and store the xormaps in the root decoder. Use the xormaps in a new lookup, cxl_hb_xor(), to discover a targets entry in a host bridge interleave target list.

Defined in CXL Spec 3.0 Section: 9.17.1

---
Changes in v2:
- Use ilog2() of the decoded interleave ways to determine number of xormaps, instead of using encoded ways directly. This fixes 3, 6, and 12 way interleaves. (Dan)

 drivers/cxl/cxl.h  |  2 +
 drivers/cxl/acpi.c | 94 +++++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 91 insertions(+), 5 deletions(-)
drivers/cxl/cxl.h +2 -0
index f680450f0b16..0a17a7007bff 100644
@@ -330,12 +330,14 @@ struct cxl_switch_decoder {
  * @res: host / parent resource for region allocations
  * @region_id: region id for next region provisioning event
  * @calc_hb: which host bridge covers the n'th position by granularity
+ * @platform_data: platform specific configuration data
  * @cxlsd: base cxl switch decoder
  */
 struct cxl_root_decoder {
 	struct resource *res;
 	atomic_t region_id;
 	struct cxl_dport *(*calc_hb)(struct cxl_root_decoder *cxlrd, int pos);
+	void *platform_data;
 	struct cxl_switch_decoder cxlsd;
 };
 
drivers/cxl/acpi.c +89 -5

119 lines not on this page · raw message

Signature · 1 line
2.31.1
author maintainer
#3 lore raw
In reply to [email protected]
Quoted 7 lines · Alison

From: Alison Schofield <[email protected]>

Changes in v2:
- Use ilog2() of the decoded interleave ways to determine number of xormaps, instead of using encoded ways directly. This fixes 3, 6, and 12 way interleaves. (Dan)

Dan - Thanks for the message about this breaking 3-6-12. New version in the works.

Quoted 24 lines

Add support for the new 'XOR' Interleave Arithmetic as defined in the CXL 3.0 Specification [1].

A linux-ized ACPI patch is included here for reference. The actual pull request is pending at https://github.com/acpica/acpica/pull/787

[1]: https://www.computeexpresslink.org/download-the-specification

Alison Schofield (2):
For ACPICA: Add the CXIMS structure definition to the CEDT table cxl/acpi: Support CXL XOR Interleave Math (CXIMS)

 include/acpi/actbl1.h | 14 ++++++-
 drivers/cxl/cxl.h     |  2 +
 drivers/cxl/acpi.c    | 94 ++++++++++++++++++++++++++++++++++++++++---
 3 files changed, 104 insertions(+), 6 deletions(-)

base-commit: 1cd8a2537eb07751d405ab7e2223f20338a90506

Signature · 1 line
2.31.1