cxl/trace: Add an HPA to cxl_poison trace events
authorAlison Schofield <alison.schofield@intel.com>
Tue, 18 Apr 2023 17:39:08 +0000 (10:39 -0700)
committerDan Williams <dan.j.williams@intel.com>
Sun, 23 Apr 2023 18:46:13 +0000 (11:46 -0700)
commit28a3ae4ff66c622448f5dfb7416bbe753e182eb4
treed6e343fbfcb6a2dc3b7dc9647cb19ee20715b6ff
parentf0832a58639691af575fa28ffaeb657c51f3ca06
cxl/trace: Add an HPA to cxl_poison trace events

When a cxl_poison trace event is reported for a region, the poisoned
Device Physical Address (DPA) can be translated to a Host Physical
Address (HPA) for consumption by user space.

Translate and add the resulting HPA to the cxl_poison trace event.
Follow the device decode logic as defined in the CXL Spec 3.0 Section
8.2.4.19.13.

If no region currently maps the poison, assign ULLONG_MAX to the
cxl_poison event hpa field.

Signed-off-by: Alison Schofield <alison.schofield@intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Link: https://lore.kernel.org/r/6d3cd726f9042a59902785b0a2cb3ddfb70e0219.1681838292.git.alison.schofield@intel.com
Tested-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/cxl/core/trace.c
drivers/cxl/core/trace.h