diff mbox series

[GIT,PULL] Compute Express Link (CXL) for 6.8

Message ID 65a1ecd2b9b02_293042946b@dwillia2-mobl3.amr.corp.intel.com.notmuch (mailing list archive)
State Handled Elsewhere, archived
Headers show
Series [GIT,PULL] Compute Express Link (CXL) for 6.8 | expand

Pull-request

git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl tags/cxl-for-6.8

Commit Message

Dan Williams Jan. 13, 2024, 1:52 a.m. UTC
Hi Linus, please pull from:

  git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl tags/cxl-for-6.8

...to receive the CXL update for this cycle.

The bulk of this update is support for enumerating the performance
capabilities of CXL memory targets and connecting that to a platform CXL
memory QoS class. Some follow-on work remains to hook up this data into
core-mm policy, but that is saved for v6.9. The next significant update
is unifying how CXL event records (things like background scrub errors)
are processed between so called "firmware first" and native error record
retrieval. The CXL driver handler that processes the record retrieved
from the device mailbox is now the handler for that same record format
coming from an EFI/ACPI notification source. It also contains
miscellaneous feature updates, like Get Timestamp, and other fixups.

This has all appeared in -next with some conflicts identified with the
ACPI tree. My resolution against your tree as of this evening is
included below. It otherwise to my knowledge has no open reports. It has
acks from Ard, Bjorn, Greg, and Rafael where appropriate.

Now, since this pull request message is also read by others keeping tabs
on the CXL subsystem, there is some additional color to add. For someone
who might be interested in platform firmware history, i.e. the evolution
of data structures passed to an OS to enumerate memory resources and
capabilities, I think this update marks an inflection point.

ACPI has long enumerated details about the platform that have no
standard enumeration. It produces tables like SRAT, SLIT, and HMAT to
describe the NUMA topology (ACPI proximity domains) and the relative
performance of an initiator, like a CPU, in one proximity domain talking
to a target, like memory, in another. 

The algorithm for where proximity domain boundaries are drawn and the
veracity of the "NUMA distance" values have long been in the category
of, "just trust the ACPI tables". However, with this update Linux is
empowered, at least for CXL, to enumerate those details itself. This is
important because ACPI is a boot time static enumeration with limited
update capabilities. That limitation is a liability in a CXL world that
supports hotplug, dynamic reconfiguration, pooling, and accelerators
with their own memory subsystems.

So now when core-mm developers notice broken memory NUMA information
they can send a patch to the CXL subsystem rather than a bug report to
the platform vendor.

---

The following changes since commit 861deac3b092f37b2c5e6871732f3e11486f7082:

  Linux 6.7-rc7 (2023-12-23 16:25:56 -0800)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl tags/cxl-for-6.8

for you to fetch changes up to 73bf93edeeea866b0b6efbc8d2595bdaaba7f1a5:

  cxl/core: use sysfs_emit() for attr's _show() (2024-01-12 14:47:04 -0800)

----------------------------------------------------------------
cxl for v6.8

- Add support for parsing the Coherent Device Attribute Table (CDAT)

- Add support for calculating a platform CXL QoS class from CDAT data

- Unify the tracing of EFI CXL Events with native CXL Events.

- Add Get Timestamp support

- Miscellaneous cleanups and fixups

----------------------------------------------------------------
Alison Schofield (1):
      cxl/region: Add dev_dbg() detail on failure to allocate HPA space

Dan Williams (6):
      Merge branch 'for-6.8/cxl-cdat' into for-6.8/cxl
      cxl/port: Fix missing target list lock
      Merge branch 'for-6.8/cxl-cdat' into for-6.8/cxl
      Merge branch 'for-6.8/cxl-misc' into for-6.8/cxl
      Merge branch 'for-6.7/cxl' into for-6.8/cxl
      Merge branch 'for-6.8/cxl-cper' into for-6.8/cxl

Dave Jiang (25):
      cxl: Fix unregister_region() callback parameter assignment
      lib/firmware_table: tables: Add CDAT table parsing support
      base/node / acpi: Change 'node_hmem_attrs' to 'access_coordinates'
      acpi: numa: Create enum for memory_target access coordinates indexing
      acpi: numa: Add genport target allocation to the HMAT parsing
      acpi: Break out nesting for hmat_parse_locality()
      acpi: numa: Add setting of generic port system locality attributes
      acpi: numa: Add helper function to retrieve the performance attributes
      cxl: Add callback to parse the DSMAS subtables from CDAT
      cxl: Add callback to parse the DSLBIS subtable from CDAT
      cxl: Add callback to parse the SSLBIS subtable from CDAT
      cxl: Add support for _DSM Function for retrieving QTG ID
      cxl: Calculate and store PCI link latency for the downstream ports
      tools/testing/cxl: Add hostbridge UID string for cxl_test mock hb devices
      cxl: Store the access coordinates for the generic ports
      cxl: Add helper function that calculate performance data for downstream ports
      cxl: Compute the entire CXL path latency and bandwidth data
      cxl: Store QTG IDs and related info to the CXL memory device context
      cxl: Export sysfs attributes for memory device QoS class
      cxl: Check qos_class validity on memdev probe
      cxl: Introduce put_cxl_root() helper
      cxl: Convert find_cxl_root() to return a 'struct cxl_root *'
      cxl: Fix device reference leak in cxl_port_perf_data_calculate()
      cxl: Refactor to use __free() for cxl_root allocation in cxl_find_nvdimm_bridge()
      cxl: Refactor to use __free() for cxl_root allocation in cxl_endpoint_port_probe()

Davidlohr Bueso (1):
      cxl: Add Support for Get Timestamp

Huang Ying (1):
      cxl/port: Fix decoder initialization when nr_targets > interleave_ways

Ira Weiny (9):
      cxl/trace: Pass UUID explicitly to event traces
      cxl/events: Promote CXL event structures to a core header
      cxl/events: Create common event UUID defines
      cxl/events: Remove passing a UUID to known event traces
      cxl/events: Separate UUID from event structures
      cxl/events: Create a CXL event union
      acpi/ghes: Process CXL Component Events
      PCI: Introduce cleanup helpers for device reference counts and locks
      cxl/pci: Register for and process CPER events

Jim Harris (1):
      cxl/region: fix x9 interleave typo

Randy Dunlap (1):
      cxl/region: use %pap format to print resource_size_t

Shiyang Ruan (1):
      cxl/core: use sysfs_emit() for attr's _show()

 Documentation/ABI/testing/sysfs-bus-cxl |  34 +++
 MAINTAINERS                             |   1 +
 drivers/acpi/apei/ghes.c                |  89 ++++++
 drivers/acpi/numa/hmat.c                | 193 ++++++++++--
 drivers/acpi/tables.c                   |   5 +-
 drivers/base/node.c                     |  12 +-
 drivers/cxl/Kconfig                     |   3 +
 drivers/cxl/acpi.c                      | 155 +++++++++-
 drivers/cxl/core/Makefile               |   1 +
 drivers/cxl/core/cdat.c                 | 521 ++++++++++++++++++++++++++++++++
 drivers/cxl/core/core.h                 |   2 +
 drivers/cxl/core/mbox.c                 |  83 +++--
 drivers/cxl/core/memdev.c               |   2 +-
 drivers/cxl/core/pci.c                  |  36 +++
 drivers/cxl/core/pmem.c                 |   8 +-
 drivers/cxl/core/port.c                 | 167 ++++++++--
 drivers/cxl/core/region.c               |  15 +-
 drivers/cxl/core/trace.h                |  14 +-
 drivers/cxl/cxl.h                       |  47 ++-
 drivers/cxl/cxlmem.h                    | 132 +++-----
 drivers/cxl/cxlpci.h                    |  13 +
 drivers/cxl/mem.c                       |  67 +++-
 drivers/cxl/pci.c                       |  58 +++-
 drivers/cxl/port.c                      |   8 +-
 drivers/pci/pci.c                       |  38 ++-
 include/linux/acpi.h                    |  11 +
 include/linux/cxl-event.h               | 161 ++++++++++
 include/linux/fw_table.h                |  21 +-
 include/linux/memory-tiers.h            |  10 +-
 include/linux/node.h                    |   8 +-
 include/linux/pci.h                     |   3 +
 include/uapi/linux/cxl_mem.h            |   1 +
 lib/fw_table.c                          |  75 ++++-
 mm/memory-tiers.c                       |  12 +-
 tools/testing/cxl/Kbuild                |   1 +
 tools/testing/cxl/test/cxl.c            |   4 +
 tools/testing/cxl/test/mem.c            | 163 +++++-----
 37 files changed, 1845 insertions(+), 329 deletions(-)
 create mode 100644 drivers/cxl/core/cdat.c
 create mode 100644 include/linux/cxl-event.h

---
Sample conflict resolution:

+++ b/drivers/acpi/apei/ghes.c
@@@ -706,7 -762,23 +779,23 @@@ static bool ghes_do_proc(struct ghes *g
  			ghes_handle_aer(gdata);
  		}
  		else if (guid_equal(sec_type, &CPER_SEC_PROC_ARM)) {
 -			queued = ghes_handle_arm_hw_error(gdata, sev);
 +			queued = ghes_handle_arm_hw_error(gdata, sev, sync);
+ 		} else if (guid_equal(sec_type, &CPER_SEC_CXL_GEN_MEDIA_GUID)) {
+ 			struct cxl_cper_event_rec *rec =
+ 				acpi_hest_get_payload(gdata);
+ 
+ 			cxl_cper_post_event(CXL_CPER_EVENT_GEN_MEDIA, rec);
+ 		} else if (guid_equal(sec_type, &CPER_SEC_CXL_DRAM_GUID)) {
+ 			struct cxl_cper_event_rec *rec =
+ 				acpi_hest_get_payload(gdata);
+ 
+ 			cxl_cper_post_event(CXL_CPER_EVENT_DRAM, rec);
+ 		} else if (guid_equal(sec_type,
+ 				      &CPER_SEC_CXL_MEM_MODULE_GUID)) {
+ 			struct cxl_cper_event_rec *rec =
+ 				acpi_hest_get_payload(gdata);
+ 
+ 			cxl_cper_post_event(CXL_CPER_EVENT_MEM_MODULE, rec);
  		} else {
  			void *err = acpi_hest_get_payload(gdata);
  
+++ b/include/linux/acpi.h
@@@ -424,13 -425,16 +425,23 @@@ extern int acpi_blacklisted(void)
  extern void acpi_osi_setup(char *str);
  extern bool acpi_osi_is_win8(void);
  
 +#ifdef CONFIG_ACPI_THERMAL_LIB
 +int thermal_acpi_active_trip_temp(struct acpi_device *adev, int id, int *ret_temp);
 +int thermal_acpi_passive_trip_temp(struct acpi_device *adev, int *ret_temp);
 +int thermal_acpi_hot_trip_temp(struct acpi_device *adev, int *ret_temp);
 +int thermal_acpi_critical_trip_temp(struct acpi_device *adev, int *ret_temp);
 +#endif
 +
+ #ifdef CONFIG_ACPI_HMAT
+ int acpi_get_genport_coordinates(u32 uid, struct access_coordinate *coord);
+ #else
+ static inline int acpi_get_genport_coordinates(u32 uid,
+ 					       struct access_coordinate *coord)
+ {
+ 	return -EOPNOTSUPP;
+ }
+ #endif
+ 
  #ifdef CONFIG_ACPI_NUMA
  int acpi_map_pxm_to_node(int pxm);
  int acpi_get_node(acpi_handle handle);
+++ b/lib/fw_table.c
@@@ -85,9 -98,27 +98,22 @@@ acpi_get_subtable_type(char *id
  	return ACPI_SUBTABLE_COMMON;
  }
  
- static __init_or_acpilib int call_handler(struct acpi_subtable_proc *proc,
- 					  union acpi_subtable_headers *hdr,
- 					  unsigned long end)
+ static unsigned long __init_or_fwtbl_lib
+ acpi_table_get_length(enum acpi_subtable_type type,
+ 		      union fw_table_header *header)
+ {
+ 	if (type == CDAT_SUBTABLE) {
+ 		__le32 length = (__force __le32)header->cdat.length;
+ 
+ 		return le32_to_cpu(length);
+ 	}
+ 
+ 	return header->acpi.length;
+ }
+ 
 -static __init_or_fwtbl_lib bool has_handler(struct acpi_subtable_proc *proc)
 -{
 -	return proc->handler || proc->handler_arg;
 -}
 -
+ static __init_or_fwtbl_lib int call_handler(struct acpi_subtable_proc *proc,
+ 					    union acpi_subtable_headers *hdr,
+ 					    unsigned long end)
  {
  	if (proc->handler)
  		return proc->handler(hdr, end);
@@@ -127,10 -158,14 +153,13 @@@ acpi_parse_entries_array(char *id, unsi
  {
  	unsigned long table_end, subtable_len, entry_len;
  	struct acpi_subtable_entry entry;
+ 	enum acpi_subtable_type type;
  	int count = 0;
 -	int errs = 0;
  	int i;
  
- 	table_end = (unsigned long)table_header + table_header->length;
+ 	type = acpi_get_subtable_type(id);
+ 	table_end = (unsigned long)table_header +
+ 		    acpi_table_get_length(type, table_header);
  
  	/* Parse all entries looking for a match. */
  
@@@ -168,9 -209,31 +197,31 @@@
  	}
  
  	if (max_entries && count > max_entries) {
 -		pr_warn("[%4.4s:0x%02x] found the maximum %i entries\n",
 -			id, proc->id, count);
 +		pr_warn("[%4.4s:0x%02x] ignored %i entries of %i found\n",
 +			id, proc->id, count - max_entries, count);
  	}
  
 -	return errs ? -EINVAL : count;
 +	return count;
  }
+ 
+ int __init_or_fwtbl_lib
+ cdat_table_parse(enum acpi_cdat_type type,
+ 		 acpi_tbl_entry_handler_arg handler_arg,
+ 		 void *arg,
+ 		 struct acpi_table_cdat *table_header)
+ {
+ 	struct acpi_subtable_proc proc = {
+ 		.id		= type,
+ 		.handler_arg	= handler_arg,
+ 		.arg		= arg,
+ 	};
+ 
+ 	if (!table_header)
+ 		return -EINVAL;
+ 
+ 	return acpi_parse_entries_array(ACPI_SIG_CDAT,
+ 					sizeof(struct acpi_table_cdat),
+ 					(union fw_table_header *)table_header,
+ 					&proc, 1, 0);
+ }
+ EXPORT_SYMBOL_FWTBL_LIB(cdat_table_parse);

Comments

pr-tracker-bot@kernel.org Jan. 19, 2024, 12:42 a.m. UTC | #1
The pull request you sent on Fri, 12 Jan 2024 17:52:18 -0800:

> git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl tags/cxl-for-6.8

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/db5ccb9eb23189e99e244a4915dd31eedd8d428b

Thank you!
diff mbox series

Patch

diff --cc drivers/acpi/apei/ghes.c
index ab2a82cb1b0b,56a5d2ef9e0a..000000000000
--- a/drivers/acpi/apei/ghes.c
diff --cc include/linux/acpi.h
index 118a18b7ff84,8b0761c682f9..000000000000
--- a/include/linux/acpi.h
diff --cc lib/fw_table.c
index c49a09ee3853,1e5e0b2f7012..000000000000
--- a/lib/fw_table.c