linux-stable/drivers/cxl
Alison Schofield 4234d4f8b4 cxl/trace: Properly initialize cxl_poison region name
[ Upstream commit 6c87126096 ]

The TP_STRUCT__entry that gets assigned the region name, or an
empty string if no region is present, is erroneously initialized
to the cxl_region pointer. It needs to be properly initialized
otherwise it's length is wrong and garbage chars can appear in
the kernel trace output: /sys/kernel/tracing/trace

The bad initialization was due in part to a naming conflict with
the parameter: struct cxl_region *region. The field 'region' is
already exposed externally as the region name, so changing that
to something logical, like 'region_name' is not an option. Instead
rename the internal only struct cxl_region to the commonly used
'cxlr'.

Impact is that tooling depending on that trace data can miss
picking up a valid event when searching by region name. The
TP_printk() output, if enabled, does emit the correct region
names in the dmesg log.

This was found during testing of the cxl-list option to report
media-errors for a region.

Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: Jonathan Cameron <jonathan.cameron@huawei.com>
Cc: Dave Jiang <dave.jiang@intel.com>
Cc: Vishal Verma <vishal.l.verma@intel.com>
Cc: stable@vger.kernel.org
Fixes: ddf49d57b8 ("cxl/trace: Add TRACE support for CXL media-error records")
Signed-off-by: Alison Schofield <alison.schofield@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Acked-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-03 15:32:25 +02:00
..
core cxl/trace: Properly initialize cxl_poison region name 2024-04-03 15:32:25 +02:00
Kconfig cxl: Add callback to parse the DSMAS subtables from CDAT 2023-12-22 14:33:10 -08:00
Makefile cxl/pmem: Introduce nvdimm_security_ops with ->get_flags() operation 2022-11-30 16:30:47 -08:00
acpi.c cxl/acpi: Fix load failures due to single window creation failure 2024-02-20 22:58:05 -08:00
cxl.h cxl: Fix sysfs export of qos_class for memdev 2024-02-16 23:20:34 -08:00
cxlmem.h cxl: Change 'struct cxl_memdev_state' *_perf_list to single 'struct cxl_dpa_perf' 2024-02-16 23:20:34 -08:00
cxlpci.h cxl: Calculate and store PCI link latency for the downstream ports 2023-12-22 14:53:49 -08:00
mem.c cxl: Fix sysfs export of qos_class for memdev 2024-02-16 23:20:34 -08:00
pci.c acpi/ghes: Remove CXL CPER notifications 2024-02-20 22:50:52 -08:00
pmem.c cxl/mbox: Move mailbox related driver state to its own data structure 2023-06-25 14:31:08 -07:00
pmu.h cxl/pci: Find and register CXL PMU devices 2023-05-30 11:20:35 -07:00
port.c cxl: Refactor to use __free() for cxl_root allocation in cxl_endpoint_port_probe() 2024-01-05 14:36:29 -08:00
security.c Merge branch 'for-6.5/cxl-type-2' into for-6.5/cxl 2023-06-25 17:16:51 -07:00