public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/6] CXL Poison List Retrieval & Tracing
@ 2022-11-11  3:12 alison.schofield
  2022-11-11  3:12 ` [PATCH v3 1/6] trace, cxl: Introduce a TRACE_EVENT for CXL poison records alison.schofield
                   ` (5 more replies)
  0 siblings, 6 replies; 22+ messages in thread
From: alison.schofield @ 2022-11-11  3:12 UTC (permalink / raw)
  To: Dan Williams, Ira Weiny, Vishal Verma, Dave Jiang, Ben Widawsky,
	Steven Rostedt, Ingo Molnar
  Cc: Alison Schofield, linux-cxl, linux-kernel

From: Alison Schofield <alison.schofield@intel.com>

Add support for retrieving device poison lists and store the returned
error records as kernel trace events.

The handling of the poison list is guided by the CXL 3.0 Specification
Section 8.2.9.8.4.1. [1] 

Example, triggered by memdev:
$ echo 1 > /sys/bus/cxl/devices/mem3/trigger_poison_list
cxl_poison: memdev=mem3 pcidev=cxl_mem.3 region= region_uuid=00000000-0000-0000-0000-000000000000 dpa=0x0 length=0x40 source=Internal flags= overflow_time=0

Example, triggered by region:
$ echo 1 > /sys/bus/cxl/devices/region5/trigger_poison_list
cxl_poison: memdev=mem0 pcidev=cxl_mem.0 region=region5 region_uuid=bfcb7a29-890e-4a41-8236-fe22221fc75c dpa=0x0 length=0x40 source=Internal flags= overflow_time=0
cxl_poison: memdev=mem1 pcidev=cxl_mem.1 region=region5 region_uuid=bfcb7a29-890e-4a41-8236-fe22221fc75c dpa=0x0 length=0x40 source=Internal flags= overflow_time=0

Changes in v3:
- Rebase to 6.1-rc4
- Rebase picked up cxl_dpa_resource_start() (Jonathan)
- Move poison source defines to cxlmem.h from events/cxl.h
- TRACE_printk helper macros display 'Reserved' for illegal poison sources
  rather than failing to parse.
- Add region uuid to the trace event.
- Always get poison, but only parse records if tracing is enabled.(Steve)
  There was a little foresight on not moving the calcs to the event
  definition itself, as Steve also suggested. The DPA->HPA translation
  is coming, and that work seems better kept in the driver itself.
- Remove unused hpa trace field. Add back when hpa is available.
- Remove pid from cxl_poison event. Find in common event field. (Steve)
- cxl_test: Add mock support for get poison

Changes in v2:
- Added per region poison collection 
- Protect poison list w mutex
- Replace range usage w resource
- S/poison_max_mer/poison_max in cxl_dev_state kdoc (Ira)
- Renamed sysfs attribute to 'trigger_poison_list'
- _store() rm chatty dev_err() msgs (Jonathan, Dan)
- _store() use kstrtobool (Jonathan, Dan)
- _store() simplify return (Jonathan)
- cxl_memdev_visible() skip local vars on way enabled_cmds (Jonathan)
- cxl_memdev_visible() use kobj_to_dev() helper (Dan)
- Misc name shortenings and cleanups.
- Replace goto w break in cxl_mem_get_poison() do-while loop.
- Don't error out on FLAGS, record in trace event.
- Add kernel CXL_POISON__LIST_MAX (64) and guard against exceeding (Dan)
- Add current->pid to trace  (Dan)
- Return the poison length as multiple of 64 per spec (Jonathan)
- Mask starting address from record->address (Jonathan)
- Move range selection to sysfs_store and make cxl_mem_get_poison() accept it.
- Get both the volatile & persistent ranges per memdev.
- Add pci device name to trace (Dan)

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

Alison Schofield (6):
  trace, cxl: Introduce a TRACE_EVENT for CXL poison records
  cxl/mbox: Add GET_POISON_LIST mailbox command
  cxl/memdev: Add trigger_poison_list sysfs attribute
  cxl/region: Add trigger_poison_list sysfs attribute
  tools/testing/cxl: Mock the max err records field of Identify cmd
  tools/testing/cxl: Mock the Get Poison List mbox command

 Documentation/ABI/testing/sysfs-bus-cxl | 28 +++++++++
 drivers/cxl/core/mbox.c                 | 81 +++++++++++++++++++++++++
 drivers/cxl/core/memdev.c               | 41 +++++++++++++
 drivers/cxl/core/region.c               | 33 ++++++++++
 drivers/cxl/cxlmem.h                    | 51 ++++++++++++++++
 include/trace/events/cxl.h              | 80 ++++++++++++++++++++++++
 tools/testing/cxl/test/mem.c            | 35 +++++++++++
 7 files changed, 349 insertions(+)
 create mode 100644 include/trace/events/cxl.h


base-commit: f0c4d9fc9cc9462659728d168387191387e903cc
-- 
2.37.3


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2022-12-08  3:47 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-11  3:12 [PATCH v3 0/6] CXL Poison List Retrieval & Tracing alison.schofield
2022-11-11  3:12 ` [PATCH v3 1/6] trace, cxl: Introduce a TRACE_EVENT for CXL poison records alison.schofield
2022-11-16 12:19   ` Jonathan Cameron
2022-12-04 22:42   ` Dan Williams
2022-11-11  3:12 ` [PATCH v3 2/6] cxl/mbox: Add GET_POISON_LIST mailbox command alison.schofield
2022-11-16 12:41   ` Jonathan Cameron
2022-11-17 23:55     ` Alison Schofield
2022-12-07  2:41   ` Dan Williams
2022-12-07 16:10     ` Alison Schofield
2022-12-07 21:39       ` Dan Williams
2022-12-08  3:47         ` Alison Schofield
2022-11-11  3:12 ` [PATCH v3 3/6] cxl/memdev: Add trigger_poison_list sysfs attribute alison.schofield
2022-11-16 12:48   ` Jonathan Cameron
2022-11-18  0:15     ` Alison Schofield
2022-11-11  3:12 ` [PATCH v3 4/6] cxl/region: " alison.schofield
2022-11-16 12:50   ` Jonathan Cameron
2022-11-18  0:24     ` Alison Schofield
2022-11-11  3:12 ` [PATCH v3 5/6] tools/testing/cxl: Mock the max err records field of Identify cmd alison.schofield
2022-11-16 12:51   ` Jonathan Cameron
2022-11-18  0:25     ` Alison Schofield
2022-11-11  3:12 ` [PATCH v3 6/6] tools/testing/cxl: Mock the Get Poison List mbox command alison.schofield
2022-11-16 12:52   ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox