@@ -33,3 +33,16 @@ Description:
device cannot clear poison from the address, -ENXIO is returned.
The clear_poison attribute is only visible for devices
supporting the capability.
+
+
+What: /sys/kernel/debug/cxl/memX/qtg_map
+Date: Mar, 2023
+KernelVersion: v6.5
+Contact: linux-cxl@vger.kernel.org
+Description:
+ (RO) Entries of all Device Physical Address (DPA) ranges
+ provided by the device Coherent Device Attributes Table (CDAT)
+ Device Scoped Memory Affinity Structure (DSMAS) entries with
+ the matching QoS Throttling Group (QTG) id calculated from the
+ latency and bandwidth of the CXL path from the memory device
+ to the CPU.
@@ -5192,6 +5192,7 @@ M: Ben Widawsky <bwidawsk@kernel.org>
M: Dan Williams <dan.j.williams@intel.com>
L: linux-cxl@vger.kernel.org
S: Maintained
+F: Documentation/ABI/testing/debugfs-cxl
F: drivers/cxl/
F: include/uapi/linux/cxl_mem.h
@@ -45,6 +45,31 @@ static int cxl_mem_dpa_show(struct seq_file *file, void *data)
return 0;
}
+static int cxl_mem_qtg_show(struct seq_file *file, void *data)
+{
+ struct device *dev = file->private;
+ struct cxl_memdev *cxlmd = to_cxl_memdev(dev);
+ struct cxl_dev_state *cxlds = cxlmd->cxlds;
+ struct perf_prop_entry *perf;
+
+ list_for_each_entry(perf, &cxlds->perf_list, list) {
+ struct qos_class *qos_class = &perf->qos_class;
+ int i;
+
+ seq_printf(file, "%08llx-%08llx : QoS Class: ",
+ perf->dpa_range.start, perf->dpa_range.end);
+ for (i = 0; i < qos_class->nr; i++) {
+ seq_printf(file, "%d", qos_class->entries[i]);
+ if (i + 1 == qos_class->nr)
+ seq_puts(file, "\n");
+ else
+ seq_puts(file, ", ");
+ }
+ }
+
+ return 0;
+}
+
static int devm_cxl_add_endpoint(struct device *host, struct cxl_memdev *cxlmd,
struct cxl_dport *parent_dport)
{
@@ -140,6 +165,7 @@ static int cxl_mem_probe(struct device *dev)
dentry = cxl_debugfs_create_dir(dev_name(dev));
debugfs_create_devm_seqfile(dev, "dpamem", dentry, cxl_mem_dpa_show);
+ debugfs_create_devm_seqfile(dev, "qtgmap", dentry, cxl_mem_qtg_show);
if (test_bit(CXL_POISON_ENABLED_INJECT, cxlds->poison.enabled_cmds))
debugfs_create_file("inject_poison", 0200, dentry, cxlmd,