linux-stable/drivers/cxl/core
Alison Schofield 8a2e2336b8 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:28:36 +02:00
..
core.h cxl/memdev: Fix sanitize vs decoder setup locking 2023-11-20 11:59:30 +01:00
hdm.c cxl/hdm: Fix a benign lockdep splat 2024-01-10 17:17:02 +01:00
Makefile cxl/pci: Find and register CXL PMU devices 2023-05-30 11:20:35 -07:00
mbox.c cxl: Add cxl_decoders_committed() helper 2024-01-10 17:16:58 +01:00
memdev.c cxl/memdev: Hold region_rwsem during inject and clear poison ops 2024-01-10 17:17:02 +01:00
pci.c cxl/pci: Fix disabling memory if DVSEC CXL Range does not match a CFMWS window 2024-03-01 13:34:59 +01:00
pmem.c cxl/memdev: Formalize endpoint port linkage 2023-06-25 14:31:33 -07:00
pmu.c cxl/pmu: Ensure put_device on pmu devices 2024-01-10 17:16:59 +01:00
port.c cxl/port: Fix missing target list lock 2024-01-25 15:35:55 -08:00
region.c cxl/region: Allow out of order assembly of autodiscovered regions 2024-03-26 18:19:12 -04:00
regs.c cxl/core/regs: Rename @dev to @host in struct cxl_register_map 2023-11-20 11:59:31 +01:00
suspend.c PM: CXL: Disable suspend 2022-04-22 16:09:42 -07:00
trace.c cxl/trace: Add an HPA to cxl_poison trace events 2023-04-23 11:46:13 -07:00
trace.h cxl/trace: Properly initialize cxl_poison region name 2024-04-03 15:28:36 +02:00